My pagination works like;
/questions/meals/fish?page=1
I would like to modify the second parameter of this URL like:
/questions/deserts/fish?page=1
How can I change the second parameter? (preferably without modifying the routes.rb
file)
In the kaminari paginate
helper method you can override the controller and action
paginate @users, params: {controller: 'foo', action: 'bar'}
So in your case...
paginate @fishes, params: {controller: 'desserts', action: 'fish'}
Note that it has to be a valid route in your routes.rb
or when the link is clicked, the app won't accept the path.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.