jbox-web / ajax-datatables-rails

A wrapper around DataTable's ajax methods that allow synchronization with server-side pagination in a Rails app
MIT License
590 stars 227 forks source link

no implicit conversion from nil to integer #247

Closed adamw005 closed 6 years ago

adamw005 commented 7 years ago

/index,json is working for me, but the view is not working. When I visit the view I see this in the console:

# 500 Internal Server Error
GET .../prices/index.json?draw=1&columns%5B0%5D%5B…art=0&length=10&search%5Bvalue%5D=&search%5Bregex%5D=false&_=1500673004474 500 (Internal Server Error)

When I visit that link I am seeing this error:

TypeError in PricesController#index
no implicit conversion from nil to integer

The full url:

/prices/index.json?draw=1&columns%5B0%5D%5Bdata%5D=brand&columns%5B0%5D%5Bname%5D=&columns%5B0%5D%5Bsearchable%5D=true&columns%5B0%5D%5Borderable%5D=true&columns%5B0%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B0%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B1%5D%5Bdata%5D=sku&columns%5B1%5D%5Bname%5D=&columns%5B1%5D%5Bsearchable%5D=true&columns%5B1%5D%5Borderable%5D=true&columns%5B1%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B1%5D%5Bsearch%5D%5Bregex%5D=false&columns%5B2%5D%5Bdata%5D=price&columns%5B2%5D%5Bname%5D=&columns%5B2%5D%5Bsearchable%5D=true&columns%5B2%5D%5Borderable%5D=true&columns%5B2%5D%5Bsearch%5D%5Bvalue%5D=&columns%5B2%5D%5Bsearch%5D%5Bregex%5D=false&order%5B0%5D%5Bcolumn%5D=0&order%5B0%5D%5Bdir%5D=asc&start=0&length=10&search%5Bvalue%5D=&search%5Bregex%5D=false&_=1500673004474

Parameters:

{"draw"=>"1",
 "columns"=>{"0"=>{"data"=>"brand",
 "name"=>"",
 "searchable"=>"true",
 "orderable"=>"true",
 "search"=>{"value"=>"",
 "regex"=>"false"}},
 "1"=>{"data"=>"sku",
 "name"=>"",
 "searchable"=>"true",
 "orderable"=>"true",
 "search"=>{"value"=>"",
 "regex"=>"false"}},
 "2"=>{"data"=>"price",
 "name"=>"",
 "searchable"=>"true",
 "orderable"=>"true",
 "search"=>{"value"=>"",
 "regex"=>"false"}}},
 "order"=>{"0"=>{"column"=>"0",
 "dir"=>"asc"}},
 "start"=>"0",
 "length"=>"10",
 "search"=>{"value"=>"",
 "regex"=>"false"},
 "_"=>"1500673004474",
 "format"=>"json"}
mrudult commented 7 years ago

Can you paste your index.html and the js config?

n-rodriguez commented 6 years ago

Hi there! Any news?

n-rodriguez commented 6 years ago

Same as : https://github.com/jbox-web/ajax-datatables-rails/issues/252