这条路线的方法是什么?

时间:2010-11-18 17:33:22

标签: ruby-on-rails

在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'

如果我想重定向到特定群组的show动作,招募周期,招募路径是什么? 即redirect_to groups_recruitment_period_recruit_path(x,y,z)

1 个答案:

答案 0 :(得分:2)

我觉得你差不多了。它看起来应该是:

redirect_to group_recruitment_period_recruit_path(x,y,z)

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