2012-02-14 83 views
0

不同我有一個嵌套的模型嵌套的路線和控制器從模型

resources doctors do 
    resource :doctor_profile 
    resource :organization 
end 

我想有一個名爲「doctor_registration_controller」

然後我想醫生註冊這樣的事情

的註冊控制器
match 'doctor_signup', 'to:doctor_registration#new', :as => "doctor_signup" 

生成此網址

localhost:3000/doctor_signup

路徑文件應該是什麼?

回答

0

您已經在路由文件,但需要一些改變:如果你有一個新的方法doctor_registration控制器

match "/doctor_signup" => "doctor_registration#new", :as => "doctor_signup" 

應該工作。

瞭解有關在Rails Routing from the Outside In中路由指南的詳細信息。

+0

我有什麼不工作! – 2012-02-14 19:12:14

+0

@ruby_noob是的。看到我的答案。 – 2012-02-14 19:16:54