> How do I override the default route for this, so it doesn't think
> search is an id?
I can think of a few solutions to this. One way would be to add a named
route above your resource route:
map.projects_search 'projects/search', :controller => 'project_search',
:action => 'search'
Another possible way would be to use conditions on your existing route
mapping, but I'm not expert enough in routing to tell you how to do
that.
That being said, do you really need your search action to be moved out
to a different controller? Maybe you do, and that's fine, but I wanted
to get you to think about whether it's really necessary. Instead you
could just add a custom action to your existing projects controller:
map.resources :projects, :collection => { :search => :get }
--
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
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 [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---