I would like to pass an extra parameter to a member route of a resource
something like:
resources :events do
member do
get \'register/:particip
Try this:
resources :events do
member do
get 'register/:participant_type_id', :action => 'register'
end
end
Just to complete the answer with my little findings. It also confused me for quite a while.
In Rails3, the member route with parameters will not have the automatic generated xx_yy_path
helper. You need to add it providing the :as =>
part, omitted the resources
name.
Regarding the example provided, to get register_event_path
and register_event_url
, you need to define it like the following:
resources :events do
member do
get 'register/:participant_type_id', :action => 'register', :as => 'register'
end
end