S
S
Sm4llDev2020-08-24 13:38:27
Ruby on Rails
Sm4llDev, 2020-08-24 13:38:27

What is scope and why does url lead to the path of the created object in form_with?

There is a piece of code from form_with:

<%= form_with scope: :article, url: articles_path, local: true do |form| %>
Какие-то формы...
<% end %>


What is "scope:" and why does the url lead to "articles_path" and not to any other page that should accept form data? "local: true" just turns off AJAX? ":article" is just the name of the parameter we pass to the model?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question