Answer the question
In order to leave comments, you need to log in
How to set up a form for nested resources in Ruby on Rails 5.2.1 using form_with?
For nested resources in route.rb like
resources :parent, shallow: true do
resources :child
end
<%= form_for [@parent, @child] do |form| %>
<%= form_with(model: child, local: true) do |form| %>
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question