0

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.

1
  • show here routes for users_conroller in config/routes.rb
    – fl00r
    Mar 28, 2010 at 19:51

1 Answer 1

0

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

5
  • map.resources :users, :collection => {:search => :get}
    – merlin
    Mar 28, 2010 at 20:33
  • 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
    Mar 28, 2010 at 20:54
  • The users index is a search form. The results page is users/search and this also is will_paginate page #1 .
    – merlin
    Mar 28, 2010 at 20:57
  • wich rails version do you use? this looks like error in your routing. try to update your system gems
    – fl00r
    Mar 28, 2010 at 21:04
  • I can only recommend you to update your gems (gem update --system)
    – fl00r
    Mar 28, 2010 at 21:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.