views:

42

answers:

1

In my users controller I have this in a method:

 @users = User.paginate :page => params[:page], :per_page => 10,

The results are rendered on users/search. The 2nd page link points to users/search?page=2, but it leads to an unknown action error.

A: 

Possibly there is something wrong in routes.rb, so you haven't got :search=>:get rout

fl00r
map.resources :users, :collection => {:search => :get}
merlin
more information from error trace please
fl00r
It looks like it is trying to find the show action.Processing UsersController#show (for 127.0.0.1 at 2010-03-28 13:52:45) [GET] Parameters: {"action"=>"show", "id"=>"search", "page"=>"2", "controller"=>"users"}ActionController::UnknownAction (No action responded to show. Actions: check_username, create, disable, edit, enable, hide, index, make_admin, make_mod, new, redirect_to_https, remove_admin, remove_mod, search, see, and update): /usr/lib/ruby/gems/1.8/gems/validates_captcha-0.9.6/rails/init.rb:21:in `call'Rendering rescues/layout (not_found)
merlin
The users index is a search form. The results page is users/search and this also is will_paginate page #1 .
merlin
wich rails version do you use?this looks like error in your routing. try to update your system gems
fl00r
version is 2.3.5
merlin
I can only recommend you to update your gems (gem update --system)
fl00r