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

Popular posts from this blog

delphi - How to convert bitmaps to video? -

jasper reports - Fixed header in Excel using JasperReports -

python - ('The SQL contains 0 parameter markers, but 50 parameters were supplied', 'HY000') or TypeError: 'tuple' object is not callable -