0
专门的admin/countries_controller正在正确使用所有操作(index,...),除了创建记录。这里从父目录控制器定期countries_controller活跃:路由导轨管理员控制器创建操作
Started POST "/countries" for 127.0.0.1 at 2011-06-29 23:26:38 +0200
Processing by CountriesController#create as HTML
缺什么有POST操作被路由到管理/国家?
的routes.rb:
resources :countries
namespace :admin do
resources :countries
end
耙路线:
countries GET /countries(.:format) {:action=>"index", :controller=>"countries"}
POST /countries(.:format) {:action=>"create", :controller=>"countries"}
new_country GET /countries/new(.:format) {:action=>"new", :controller=>"countries"}
admin_countries GET /admin/countries(.:format) {:action=>"index", :controller=>"admin/countries"}
POST /admin/countries(.:format) {:action=>"create", :controller=>"admin/countries"}
new_admin_country GET /admin/countries/new(.:format) {:action=>"new", :controller=>"admin/countries"}
类似的问题在这里没有答案: Rails help with building Admin area - Routing problem
你是如何构建在你的视图中启动POST请求的url的? – drummondj
'<%= link_to'New Country',new_admin_country_path%>'会产生标准的scaffold form helper,包含'<%= form_for(@country)do | f | %>'和'<%= f.submit%>' – David