You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+68-1Lines changed: 68 additions & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -225,7 +225,7 @@ def data
225
225
last_name: record.last_name,
226
226
email: record.email,
227
227
bio: record.bio,
228
-
DT_RowId: record.id, # This will set the id attribute on the corresponding <tr> in the datatable
228
+
DT_RowId: record.id, # This will automagically set the id attribute on the corresponding <tr> in the datatable
229
229
}
230
230
end
231
231
end
@@ -398,6 +398,8 @@ class MyCustomDatatable < AjaxDatatablesRails::Base
398
398
end
399
399
```
400
400
401
+
### Using view decorators
402
+
401
403
If you want to keep things tidy in the data mapping method, you could use
402
404
[Draper](https://github.com/drapergem/draper) to define column mappings like below.
403
405
@@ -683,6 +685,71 @@ $ bundle install
683
685
684
686
That's all :) ([Automatically prefer Yajl or JSON backend over Yaml, if available](https://github.com/rails/rails/commit/63bb955a99eb46e257655c93dd64e86ebbf05651))
685
687
688
+
### Other advices
689
+
690
+
Use HTTP `POST` method to avoid `414 Request-URI Too Large` error. See : [#278](https://github.com/jbox-web/ajax-datatables-rails/issues/278).
691
+
692
+
You can easily define a route concern in `config/routes.rb` and reuse it when you need it :
0 commit comments