You could also do:

resources :teams do
member do
get :action_which_acts_on_member
end

collection do
get :action_which_acts_on_collection
end
end

I find this cleaner, and this also generates named path helpers without
requiring you to provide :as option.

On Tue, May 8, 2012 at 4:06 PM, Michael Baldock wrote:

I got it!

For anyone else who's a bit rails rusty, and has forgotten this the
route to the new method has to go BEFORE the other routes created by
resources :teams

match "/teams/apply_to_coach_team" => "teams#apply_to_coach_team", :as
=> :apply_to_coach_team

resources :teams

This makes sense when I think about it!

--
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 rubyonrails-talk@googlegroups.com.
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.

--
- Aziz M. Bookwala

Website <http://azizmb.in/> | Twitter <https://twitter.com/azizbookwala> |
Github <http://github.com/azizmb>

--
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@googlegroups.com.
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.

Search Discussions

Discussion Posts

Previous

Follow ups

Related Discussions

Discussion Navigation
viewthread | post
posts ‹ prev | 3 of 5 | next ›
Discussion Overview
grouprubyonrails-talk @
categoriesrubyonrails
postedMay 8, '12 at 10:10a
activeMay 10, '12 at 8:41a
posts5
users3
websiterubyonrails.org
irc#RubyOnRails

People

Translate

site design / logo © 2022 Grokbase