我在routes.rb
中建立了唯一一个namespace:
namespace :help do
root "qandas#index"
resources :qandas
end
同时也建立好了对应的Controller和view.
然后页面,报错:
ActionController::UrlGenerationError in Help::Qandas#index
No route matches {:action=>"index", :controller=>"help/search", :id=>nil}
报错的代码是:
= form_tag({:controller => 'search', :action => 'index', :id => @project}, :method => :get ) do
...
这就意味着,当我使用namespace的时候,会影响到以前通过{:controller => 'search', :action => 'index', :id => @project}
来定义的 url的地方。
有没有办法可以规避这一点?
I also encountered this problem. . . In distress, have you solved it now?