1
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 1 year has passed since last update.

rails7 devise action mailerにてパスワード再設定メールを送ろうとするとNil location provided. Can't build URI.が出る件

Last updated at Posted at 2023-02-07

前提条件

  • Rails 7.0.4
  • Devise 4.8.1
  • actionmailer 7.0.4

事象

パスワード再設定用ページから宛先のメールアドレスを入力し、送信ボタンを押下すると下のエラー画面が表示される
スクリーンショット 2023-02-07 12.18.38.png

スクリーンショット 2023-02-07 12.18.16.png

対応

フォームのturboを無効化する

この対応は応急処置です!
Deviseの4.9.0のバージョンでは解決されるようですd(^_^o)
こちらのPR↓にてfixされるとのことです👀
Integrate with Hotwire/Turbo by configuring error and response statuses #5548
adviced by @jnchito (special thanks)

Before

= simple_form_for(***, as: ***, url: password_path(resource_name), html: {  method: :post }) do |f|

After

= simple_form_for(***, as: ***, url: password_path(resource_name), html: { 'data-turbo': 'false', method: :post }) do |f|

参考

Getting ArgumentError (Nil location provided. Can't build URI.) after submitting password reset form on development #5468

1
0
2

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
1
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?