will_paginate route only works on page > 1

Posted by Avishai on Stack Overflow See other posts from Stack Overflow or by Avishai
Published on 2010-04-16T09:55:05Z Indexed on 2010/04/16 15:13 UTC
Read the original article Hit count: 164

I have the following routes defined:

map.resources :categories, :has_many => :downloads
map.resources :downloads, :member => {:go => :get}, :collection => {:tag => :get}
map.connect '/downlods/page/:page', :controller => 'downloads', :action => 'index'
map.connect '/categories/:category_id/downloads/page/:page', :controller => 'downloads', :action => 'index'

For some reason, the first page that the will_paginate helper is called on causes links with ?page=2 to be rendered, while subsequent pages have links with /downloads/page/2. Do you know what might be causing this?

© Stack Overflow or respective owner

Related posts about ruby

Related posts about will-paginate