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 <[email protected]>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 [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.
>
>
--
- 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 [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.