2013-04-17 29 views
0

目前我有下面的路線。Rails嵌套路線使用:僅限。如何添加額外的路線?

路線

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 

什麼是實現的最佳途徑這個?

回答

3
resources :applications do 
    resources :jobseeker, :only=> [:index, :new, :create] do 
    collection do 
     get :load 
     post :retrieve 
    end 
    end 
end