Skip to content

Commit 67d7581

Browse files
committed
Update README [ci skip]
1 parent bd9e163 commit 67d7581

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

README.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -438,6 +438,9 @@ end
438438
If you want to keep things tidy in the data mapping method, you could use
439439
[Draper](https://github.com/drapergem/draper) to define column mappings like below.
440440

441+
**Note :** This is the recommanded way as you don't need to inject the `view_context` in the Datatable object to access helpers methods.
442+
It also helps in separating view/presentation logic from filtering logic (the only one that really matters in a datatable class).
443+
441444
Example :
442445

443446
```ruby
@@ -483,8 +486,6 @@ class UserDecorator < ApplicationDecorator
483486
end
484487
```
485488

486-
This way you don't need to inject the `view_context` in the Datatable object to access helpers methods.
487-
488489
### Pass options to the datatable class
489490

490491
An `AjaxDatatablesRails::ActiveRecord` inherited class can accept an options hash at initialization. This provides room for flexibility when required.

0 commit comments

Comments
 (0)