2

Since upgrading Rails from 5.1 to 5.2, form_with is not defaulting to remote: true, although it was in rails 5.1

How to default to remote true?

Nicolas Maloeuvre
  • 3,069
  • 24
  • 42

1 Answers1

4
#config/initializers/form_with_remote.rb
Rails.application.config.action_view.form_with_generates_remote_forms = true

I don't understand why, because the default should be true... but it works

Nicolas Maloeuvre
  • 3,069
  • 24
  • 42
  • I think it might be that because your app (and mine) were created with an older version of Rails, the variable was never defined in our config files, but 5.2 expects it to be defined explicitly with `form_with_generates_remote_forms`. Your answer helped me! – MSC Apr 04 '20 at 07:43