laredotornado-8iDLEspWrrZBDgjK7y7TUQ@public.gmane.org
2008-Feb-11  05:27 UTC
Trouble with "namespace" in routes.rb file
Hi,
Following some of AndyV''s useful advice, I added this
  map.namespace :admin do |adm|
    adm.resources :client
  end
to my config/routes.rb file.  However, when I visit
http://mydomain.com/admin/client/search I get the error:
Unknown action
No action responded to show
I am extremely confused b/c nowhere do I  make reference to a "show"
action.  Here is the code of my app/controllers/admin/
client_controller.rb file
=============Begin client_controller.rb file===================class
Admin::ClientController < ApplicationController
        def search
        end
        def searchresults
                @users = User.search(params)
        end
        def userdetails
        end
end
=============End client_controller.rb file====================
I do have a file, app/views/admin/client/search.rhtml, so I''m not sure
why its not getting called.  Thanks, - Dave
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
adm.resources :client
should be
   adm.resources :client, :collection => { :search => :get }
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---
laredotornado-8iDLEspWrrZBDgjK7y7TUQ@public.gmane.org
2008-Feb-11  15:47 UTC
Re: Trouble with "namespace" in routes.rb file
Thanks, Ryan. That worked. So just to be clear, every time I want to add a new method to Admin::ClientController, I have to also add that to the collection listed below? - Dave On Feb 11, 12:03 am, "Ryan Bigg (Radar)" <radarliste...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org> wrote:> adm.resources :client > > should be > adm.resources :client, :collection => { :search => :get }--~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org To unsubscribe from this group, send email to rubyonrails-talk-unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---