I have a page which is used for searching through listings by submitting data using the supplied forms. The form parameters are submitted via ajax (post request), a new record i
Old Post. Better solution.
If you are using kaminari for pagination for nested resources with ajax updates, you will find Kaminari attempts to build the url based on the current path, regardless of the params you specify, resulting in a routing error.
The cleanest solution is to use a wildcard route.
If your paginating comments for a post and have a comments controller with a create and show action, then:
In your routes:
match '*path/comments(/:page)' => 'comments#show'
And the pagination widget:
<%= paginate @comments, params: { controller: :comments }, remote: true %>