LoginSignup
0
1

More than 3 years have passed since last update.

【devise】 管理者 ユーザー ログイン、ログアウト分ける

Posted at

【ゴール】

deviseで管理者とユーザーのログインとログアウトを別物にする。
どちらかがログイン、ログアウトするとviewの内容の変更を防ぐ為

参考にしたページ:https://pinzolo.github.io/2016/01/30/devise-not-sign-out-all-scopes.html

【開発環境】

■ Mac OS catalina
■ Ruby on Rails (5.2.4.2)
■ Virtual Box:6.1
■ Vagrant: 2.2.7

【実装】

とても簡単!!
下記ファイルの243行目あたりの記述を変更

config/initializers/devise.rb

# config.sign_out_all_scopes = true #これを

             ↓

config.sign_out_all_scopes = false #これに

以上

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