I've got routes setup like the following:
resources :projects do
resources :project_factors, as: factors
end
I like having the as: :factors
so the route becomes:
project_factor_path(@project, @project_factor)
instead of
project_project_factor_path(@project, @project_factor)
but I'm having trouble getting form_for
to generate the correct route.
form_for [@project, @project_factor]
fails (as expected) because it tries to use project_project_factor_path
, so I tried:
form_for [@project, @project_factor], as: :factor
but this fails with exactly the same error.
Is there a way to get rails to generate the correct path here without explicitly setting the correct url
parameter for the create and update case?