[Rails] About local: true described in form_with

Why write local: true

When submitting a form with rails, describe local: true under form_with, At first, I didn't understand the meaning and wrote the code by imitating it without thinking deeply about what it was.

form_with.png

However, it is unpleasant to proceed with learning without understanding the meaning, so when I looked it up again, In rails5, if you do not describe local: true, it means sending the form by ajax communication, so when you send the form as HTML, you need to describe local: true.

Recommended Posts

[Rails] About local: true described in form_with
About redirect_to in form_with
About the symbol <%%> in Rails erb
About Rails 6
[Rails] Run LINEBot in local environment using ngrok
rails tutorial About account activation in production environment
About var used in Java (Local Variable Type)
Group_by in Rails
[Rails] About ActiveJob ,!
About Rails controller
Questions about implementing the Like feature (Ajax) in Rails
SSL in the local environment of Docker / Rails / puma
[Rails] About migration files
[Rails 6] About main gems
[Rails] About active hash
Model association in Rails
Adding columns in Rails
About rails version specification
Disable turbolinks in Rails
^, $ in Rails regular expression
Use images in Rails
Understand migration in rails
About form. ○○ of form_with
[rails] About devise defaults
Split routes.rb in Rails6
[Rails] Completely understand form_with
About rails strong parameters
[Beginner] About Rails Session
Implement markdown in Rails
When using Slim in Ruby on Rails, "undefined local variable or method` f'for "is displayed in form_with