로그인 기본 틀 완성
This commit is contained in:
@@ -1,13 +1,19 @@
|
||||
class PlainpageController < ApplicationController
|
||||
|
||||
before_action :require_login
|
||||
|
||||
def index
|
||||
unless user_signed_in?
|
||||
redirect_to '/users/sign_in'
|
||||
end
|
||||
flash[:success ] = "Success Flash Message: Welcome to GentellelaOnRails"
|
||||
#other alternatives are
|
||||
# flash[:warn ] = "Israel don't quite like warnings"
|
||||
#flash[:danger ] = "Naomi let the dog out!"
|
||||
end
|
||||
|
||||
|
||||
|
||||
# CHECK SIGNED IN FOR USING THE SERVICE
|
||||
def require_login
|
||||
unless user_signed_in?
|
||||
flash[:danger] = "서비스 이용을 위한 로그인이 필요합니다."
|
||||
redirect_to '/users/sign_in' # halts request cycle
|
||||
end
|
||||
end
|
||||
end
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
class Users::ConfirmationsController < Devise::ConfirmationsController
|
||||
layout "login_pages"
|
||||
# GET /resource/confirmation/new
|
||||
# def new
|
||||
# super
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
class Users::OmniauthCallbacksController < Devise::OmniauthCallbacksController
|
||||
layout "login_pages"
|
||||
# You should configure your model like this:
|
||||
# devise :omniauthable, omniauth_providers: [:twitter]
|
||||
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
class Users::PasswordsController < Devise::PasswordsController
|
||||
layout "login_pages"
|
||||
# GET /resource/password/new
|
||||
# def new
|
||||
# super
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
class Users::RegistrationsController < Devise::RegistrationsController
|
||||
layout "login_pages"
|
||||
# before_action :configure_sign_up_params, only: [:create]
|
||||
# before_action :configure_account_update_params, only: [:update]
|
||||
|
||||
@@ -8,9 +9,9 @@ class Users::RegistrationsController < Devise::RegistrationsController
|
||||
# end
|
||||
|
||||
# POST /resource
|
||||
# def create
|
||||
# super
|
||||
# end
|
||||
def create
|
||||
super
|
||||
end
|
||||
|
||||
# GET /resource/edit
|
||||
# def edit
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
class Users::UnlocksController < Devise::UnlocksController
|
||||
layout "login_pages"
|
||||
# GET /resource/unlock/new
|
||||
# def new
|
||||
# super
|
||||
|
||||
Reference in New Issue
Block a user