I am working on a project where we will not use ajax calls to submit forms, so I need to put local: true
in each form of the project, as indicated in the docs rails :
:local - By default form submits are remote and unobstrusive XHRs. Disable remote submits with local: true.
Is it possible to set the default local parameter by default?
We use the Rails 5 helper form_with
as follows:
<%= form_with(model: @user, local: true) do |f| %>
<div>
<%= f.label :name %>
<%= f.text_field :name %>
</div>
<div>
<%= f.label :email %>
<%= f.email_field :email %>
</div>
<%= f.submit %>
<% end %>
source
share