0
0

More than 1 year has passed since last update.

deviseでログアウトできなかった件

Posted at

躓いたところの備忘録として・・・:point_up:

Routing Error
No route matches [GET] "/users/sign_out"
というエラー

view側で

application.html.erb
<%= link_to 'ログアウト', destroy_user_session_path, method: :delete, class: :logout %>

という記述をしており、method: :deleteも記述している!!

route.rbに
 devise_scope :user do
    get '/users/sign_out' => 'devise/sessions#destroy'
  end

という記述もあるそうだが、ルーティングをいじりたくなかったので、

config/initializers/devise.rbの
config.sign_out_via = :delete```
を:getに変更!!

変わらず、ルーティングエラーだったが、サーバーを再起動したところ、解決!!
気持ちいい!
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