I'm getting the following error in my view with form_for when I use the path edit_projects_proj_paquet_mesures_proj_mesure_path() :
undefined method `projects_proj_mesure_path' for #<#<Class:0xac942e4>:0xac9d1f0>
This error doesn't occur when I use the path new_projects_proj_paquet_mesures_proj_mesure_path().
Though I defined my ressource as nested with a namespace in my config/route.rb
namespace :projects do
resources :proj_paquets_mesures do
resources :proj_mesures
end
end
As recommended in this stackoverflow question-answer, my _form.html.haml begin with :
form_for([:projects, @proj_paquet_mesures, @proj_mesure], :html => {:class => "formulaire-standard"}) do |f|
...
Be aware an exception has been set within config/initializer/inflection.rb :
ActiveSupport::Inflector.inflections do |inflect|
inflect.irregular 'proj_paquet_mesures', 'proj_paquets_mesures'
end
Everything was working fine when I was using Shallow option for my ressources, and using the path projects_proj_mesure_path() :
namespace :projects do
resources :proj_paquets_mesures, :shallow => true do
resources :proj_mesures
end
end