0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[Rails] Post 401エラー Uncaught SytaxError が@rails-ujsで起きている時の対処

0
Last updated at Posted at 2020-01-06

エラーの背景

form_forをform_withに書き換えた際、Deviseを用いたログイン後の
「ログインしました。」というflashが表示されなくなったことをきっかけに検証ツールでこのエラーにたどり着きました。
 2020-01-06 16.44.21.png

対処法

結論から言うと form_withの記述にlocal:trueが足りてなかったことにより、ajaxの処理などがうまくいかなかったようです。

    = form_with model: @user, url: user_session_path,local: true do |f|

今後は描き忘れないようしっかり注意したいと思います!!
以上です。

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?