逆に、同期の POST にしようと思ったら明示的に remote: false とする訳ですが、 Rails 5.1 で form_with に remote: false を書いても POST にならない。
調べてみると、local オプションというものになったようです。
加えてどうやらデフォルトが ajax の様子。ちょっと引っかかりました。
とはいえ実態は data-remote に false を設定しているだけなので
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
form_with(url: hoge_url, data: {remote: false}) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
form_with(url: hoge_url, local: true) |
環境
- macOS Sierra 10.12.6
- ruby 2.4.1p111 (2017-03-22 revision 58053) [x86_64-darwin16]
- Rails 5.1.3