diff options
| author | mo <mo.khan@gmail.com> | 2017-09-24 13:53:09 -0600 |
|---|---|---|
| committer | mo <mo.khan@gmail.com> | 2017-09-24 13:53:09 -0600 |
| commit | 4887ba54da7ff8a25347b58c4a426cb5cf1dee3b (patch) | |
| tree | 5327f65dafd3f8a4881053d5da0d601f4c2e918a /app/controllers | |
| parent | dc702a89811e866eec20cc43763096dddf4a41fe (diff) | |
render categories as backbone collection in html page.
Diffstat (limited to 'app/controllers')
| -rw-r--r-- | app/controllers/application_controller.rb | 10 | ||||
| -rw-r--r-- | app/controllers/sessions_controller.rb | 2 |
2 files changed, 6 insertions, 6 deletions
diff --git a/app/controllers/application_controller.rb b/app/controllers/application_controller.rb index bcb68012..951a53c3 100644 --- a/app/controllers/application_controller.rb +++ b/app/controllers/application_controller.rb @@ -4,8 +4,8 @@ class ApplicationController < ActionController::Base # For APIs, you may want to use :null_session instead. protect_from_forgery with: :exception before_action :load_header - #before_action :extend_session_cookie - helper_method :current_user, :user_signed_in? + before_action :extend_session_cookie + helper_method :current_user, :current_user? rescue_from ActiveRecord::RecordNotFound, with: :record_not_found def user_session(session_key = session[:raphael]) @@ -16,8 +16,8 @@ class ApplicationController < ActionController::Base user_session.try(:user) end - def user_signed_in? - current_user + def current_user? + current_user.present? end private @@ -31,7 +31,7 @@ class ApplicationController < ActionController::Base end def extend_session_cookie - session[:raphael] = user_session.access(request) if user_signed_in? + session[:raphael] = user_session.access(request) if current_user? end def record_not_found diff --git a/app/controllers/sessions_controller.rb b/app/controllers/sessions_controller.rb index 564569b4..ca139465 100644 --- a/app/controllers/sessions_controller.rb +++ b/app/controllers/sessions_controller.rb @@ -1,6 +1,6 @@ class SessionsController < ApplicationController def new - redirect_to my_dashboard_path if user_signed_in? + redirect_to my_dashboard_path if current_user? @session = UserSession.new end |
