2
1

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のログアウトができない

Last updated at Posted at 2022-05-22

発生したエラー

Routing Error
No route matches [GET]

Devise使用時に、ログアウトができず。。
コードには、method: :delete と記入しているのに get が反応する

【変更前】
<%= link_to 'ログアウト', destroy_owner_session_path, method: :delete %>

解決方法

:confetti_ball:ログイン成功:tada:

buttonスタイルなら
method: :deleteが機能してくれる

【変更後】
<%= button_to 'ログアウト', destroy_owner_session_path, method: :delete %>
2
1
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
2
1

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?