File tree Expand file tree Collapse file tree 1 file changed +6
-3
lines changed
lib/ajax-datatables-rails Expand file tree Collapse file tree 1 file changed +6
-3
lines changed Original file line number Diff line number Diff line change @@ -73,13 +73,11 @@ def additional_data
73
73
74
74
# JSON structure sent to jQuery DataTables
75
75
def as_json ( *)
76
- draw_resp = ( params [ :draw ] . present? ) ? { draw : params [ :draw ] . to_i } : { }
77
-
78
76
{
79
77
recordsTotal : records_total_count ,
80
78
recordsFiltered : records_filtered_count ,
81
79
data : sanitize_data ( data ) ,
82
- } . merge ( draw_resp ) . merge ( additional_data )
80
+ } . merge ( draw_id ) . merge ( additional_data )
83
81
end
84
82
85
83
# User helper methods
@@ -154,6 +152,11 @@ def global_search_delimiter
154
152
GLOBAL_SEARCH_DELIMITER
155
153
end
156
154
155
+ # See: https://datatables.net/manual/server-side#Returned-data
156
+ def draw_id
157
+ params [ :draw ] . present? ? { draw : params [ :draw ] . to_i } : { }
158
+ end
159
+
157
160
def raw_records_error_text
158
161
<<-ERROR
159
162
You can’t perform that action at this time.
0 commit comments