2010-11-18 62 views
0

在routes.rb中我有,这是什么路线的方法

map.resources :groups, :collection => { :find_or_create => :get, :search => :get } do |group| 
group.resources :recruitment_periods, :controller => 'groups/recruitment_periods' do |period| 
    period.resources :recruits,  :controller => 'groups/recruitment_periods/recruits' 

如果我想重定向到一个特定的群体,recruit_period的表演动作,将招募的路径是什么? 即redirect_to groups_recruitment_period_recruit_path(x,y,z)

回答

2

我想你几乎已经拥有了它。它看起来应该是:

redirect_to group_recruitment_period_recruit_path(x,y,z) 

没有复数组,因为你知道哪一个。