I'm having a problem with kaminari, it doesn't seem to be able to paginate results when using a custom "unRestful" url.
resources :provinces, :path => '', :only => [ :show ] do
resources :sports, :only => [ :show ] do
match ':page', :controller => 'facilities', :action => 'index'
end
end
So, /:foo/sports/:bar points to a controller, /:foo/sports/:bar/1 points to another 1. It's a disgusting URL scheme but I don't have the leverage right now to change the specs.
If I call the page without Kaminari, everything works as expected, I see the first page. When I use Kaminari like:
<%= paginate @facilities, :params => { :controller => 'facilities', :action => 'index' } %>
Rails gives me a routing error on the following URL:
http://lvh.me:8080/milano/sports/palestra/1
No route matches {:controller=>"facilities", :province_id=>"milano", :sport_id=>"palestra", :page=>nil}
I honestly don't know what to do, everything seems right to me, and couldn't find a kaminari group or more documentation on my case.
The problem seems to be that the call to paginate somewhat generates a URL with page set to nil...
Any suggestion?
Using rails (3.2.8) Using kaminari (0.14.0)