mislav/will_paginate

Pagination links and parameters in Rails 5.0.0.1

Closed this issue · 3 comments

Hi, I have a problem whit will_paginate 3.1.0 and rails 5.0.0.1.
The problem has to do with nested parameters.

Example:

https://www.example.com/products?page=1&search[field]=e

Page is correctly loaded, but pages links are not correctly build, for example for page 2 I get:

http://www.example.com/products?page=2&search=%23%3CActionController%3A%3AParameters%3A0xb2417668%3E&utf8=%E2%9C%93

It seems that nested ActionController::Parameters instances are not converted...

Any idea?

Many thanks.

@mislav is it possible to fix this issue, please?
Many thanks in advance.

My team ran into this issue with a Rails 5 upgrade as well. Our workaround has been to explicitly pass an unsafe hash of the params to will_paginate and paginated_section.

will_paginate relvant_data

becomes

will_paginate relevant_data, params: params.to_unsafe_h

@patientdev thx, this can be a temporary workaround