0

目前我有以下路线。

路线

resources :applications do 
  resources :jobseeker, :only=> [:index, :new, :create]
end

get 'jobseeker/load' => 'jobseeker#load'
post 'jobseeker/retrieve' => 'jobseeker#retrieve'

他们产生这样的网址:

/applications/1/jobseeker/index
/applications/1/jobseeker/new
/applications/1/jobseeker/create
/jobseeker/load
/jobseeker/retrieve

但我想要的是有这样的网址:

/applications/1/jobseeker/index
/applications/1/jobseeker/new
/applications/1/jobseeker/create
/applications/1/jobseeker/load
/applications/1/jobseeker/retrieve

实现这一目标的最佳方法是什么?

4

1 回答 1

3
resources :applications do 
  resources :jobseeker, :only=> [:index, :new, :create] do
    collection do
      get  :load
      post :retrieve
    end
  end
end
于 2013-04-17T15:33:56.790 回答