File tree Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Expand file tree Collapse file tree 1 file changed +3
-2
lines changed Original file line number Diff line number Diff line change 438438If 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+
441444Example :
442445
443446``` ruby
@@ -483,8 +486,6 @@ class UserDecorator < ApplicationDecorator
483486end
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
490491An ` AjaxDatatablesRails::ActiveRecord ` inherited class can accept an options hash at initialization. This provides room for flexibility when required.
You can’t perform that action at this time.
0 commit comments