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
7373
7474 # JSON structure sent to jQuery DataTables
7575 def as_json ( *)
76- draw_resp = ( params [ :draw ] . present? ) ? { draw : params [ :draw ] . to_i } : { }
77-
7876 {
7977 recordsTotal : records_total_count ,
8078 recordsFiltered : records_filtered_count ,
8179 data : sanitize_data ( data ) ,
82- } . merge ( draw_resp ) . merge ( additional_data )
80+ } . merge ( draw_id ) . merge ( additional_data )
8381 end
8482
8583 # User helper methods
@@ -154,6 +152,11 @@ def global_search_delimiter
154152 GLOBAL_SEARCH_DELIMITER
155153 end
156154
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+
157160 def raw_records_error_text
158161 <<-ERROR
159162
You can’t perform that action at this time.
0 commit comments