Veteran users of Rails would expect form_with helpers to return an HTML response, just like all the previous form helpers. However, the default option was now switched to an AJAX response.
With the latest change, it is often confusing for beginners to render out JS responses from the get-go. Fortunately with a recent PR to Rails, it has now been reverted back to rendering default HTML responses.
form_with would generate a remote form by default.
This would submit the form as an AJAX request.
It is possible to change it by using the
true would submit the form as an HTML request.
Now, all new 6.1 applications will generate non-remote forms by default. There’s also an override to control the default option for Rails forms using this configuration,
This can be either set to true or false.