Closed PavloBezpalov closed 4 years ago
Hi. When i try to use POST like described in readme
$ -> $('#posts-datatable').dataTable ajax: url: $('#posts-datatable').data('source') contentType: 'application/json' type: 'POST' # ...others options, see [here](#5-wire-up-the-javascript)
i got error in Rails ActionDispatch::Http::Parameters::ParseError
So i tried to format params in json like this
$ -> $('#posts-datatable').dataTable ajax: url: $('#posts-datatable').data('source') contentType: 'application/json' type: 'POST' data: (d) -> JSON.stringify d
But I got NoMethodError: undefined method to_unsafe_h' for #<Array at ajax-datatables-rails-1.1.0/lib/ajax-datatables-rails/datatable/datatable.rb:73:inget_param'
to_unsafe_h' for #<Array at ajax-datatables-rails-1.1.0/lib/ajax-datatables-rails/datatable/datatable.rb:73:in
Found solution. I should not use contentType: 'application/json' in first example :(
Hi. When i try to use POST like described in readme
i got error in Rails ActionDispatch::Http::Parameters::ParseError
So i tried to format params in json like this
But I got NoMethodError: undefined method
to_unsafe_h' for #<Array at ajax-datatables-rails-1.1.0/lib/ajax-datatables-rails/datatable/datatable.rb:73:in
get_param'