I'm using will_paginate (3.0.pre2) with rails 3.0.0.rc. The first page pulls up fine but when I go to page 2, it returns nothing because the query for page 2 is not being set correctly by will_paginate.
Controller:
page = params['page'].blank? ? 1 : params['page']
@posts = Post.paginate_by_sql (['select * from Foo_Table where ids = ?', params[:ids]], :page=>page, :per_page=>50)
@pag_params = {:ids=>params[:ids]}
View:
<%= will_paginate @posts, :params=>@pag_params %>
Link to page 2 is:
http://localhost:3000/posts/search?page=2&ids=1
Logs show the where clause show an incorrect (ids = 'search') when it should be (ids = '1')
SELECT * FROM `Foo_Table` WHERE (ids = 'search')
What am I missing so that the query for page 2 can be corrected?