Problem
The form_for helper incorrectly determines the path to my nested resource inside of a namespace. The models in question are: Forum::Thread and Forum::Reply respectively, located in a subfolder called "forum" under my models directory. This is in Rails 3 BETA 3.
routes.rb
namespace :forum do
root :to => 'threads#index'
resources :threads do
resources :replies
end
end
app/views/forum/replies/_form.html.haml
...
- form_for [@thread, @reply] do |f|
...
app/controllers/forum/replies_controller.rb
...
def new
@reply = Forum::Reply.new
end
...
Error
undefined method `forum_thread_forum_replies_path'
In reference to the line outlined above in _form.html.haml
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…