ruby on rails - How to route an additional action for a namespaced resource? -
in routes.rb have add "settings" additional action insurances:
namespace :modules namespace :insurance resources :insurances member :settings end end end end
according "rake routes" gives following path:
settings_modules_insurance_insurance_path
but when visit path in browser, returns error:
no route matches {:action=>"settings", :controller=>"modules/insurance/insurances"}
this full ouput of rake routes:
settings_modules_insurance_insurance /modules/insurance/insurances/:id/settings(.:format) {:action=>"settings", :controller=>"modules/insurance/insurances"}
what should do?
you've put new route on member, have pass id of insurance:
settings_modules_insurance_insurance_path(@insurance)
Comments
Post a Comment