Mapping a subroute/subaction to a controller action in Rails 3
Lets say we have a GoodTimes controller and we want to create the following mappings between routes and controller actions (in addition to the standard resources):
/good_times/new/party {:controller => "good_times", :action => "party"}
/good_times/new/afterparty {:controller => "good_times", :action => "afterparty"}
/good_times/new/eurorave {:controller => "good_times", :action => "eurorave"}
In Rails 2 land we could do:
map.resources :good_times, :new => {:party => :get, :afterparty => :get, :eurorave => :post}
Our path-helpers would then be:
party_new_good_time_path
afterparty_new_good_time_path
eurorave_new_good_time_path
What is the preferred method of accomplishing the same in Rails 3 land?
This question is answered here: Adding custom :new routes using Rails 3 rou开发者_开发知识库ting
精彩评论