[Ruby] [Rails] About local: true described in form_with

less than 1 minute read

Why local: true

Although local: true is described below form_with when submitting the form with rails, At first, I didn’t understand what it meant and didn’t think deeply what it was, and I wrote the code by imitating it.

form_with.png

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