Answer the question
In order to leave comments, you need to log in
Syntax and working of form_with in Ruby on Rails 6?
I tried to understand how form_with works, I looked for Ruby on Rails Docs , RusRails , but I didn’t understand what was happening:
<%= form_with scope: :article, url: articles_path, local: true do |form| %>
<p>
<%= form.label :title %><br>
<%= form.text_field :title %>
</p>
<p>
<%= form.label :text %><br>
<%= form.text_area :text %>
</p>
<p>
<%= form.submit %>
</p>
<% end %>
Answer the question
In order to leave comments, you need to log in
If it's not difficult, then you can explain the syntax of the moments, how it works, and what is the "crutch" with the variable |form|?
form_with(...) do |form|
end
rails routes
and understand what CRUD, REST are. # Adding a scope prefixes the input field names:
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question