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