Class: BlogBasic::AppController
- Inherits:
-
ActionController::Base
- Object
- ActionController::Base
- BlogBasic::AppController
show all
- Defined in:
- app/controllers/blog_basic/app_controller.rb
Instance Method Summary
collapse
Instance Method Details
#current_user ⇒ Object
14
15
16
17
18
19
|
# File 'app/controllers/blog_basic/app_controller.rb', line 14
def current_user
logger.info "Current user ID: " + session[:user_id].to_s
if signed_in?
@current_user ||= User.find(session[:user_id])
end
end
|
#require_user ⇒ Object
6
7
8
|
# File 'app/controllers/blog_basic/app_controller.rb', line 6
def require_user
User.new
end
|
#signed_in? ⇒ Boolean
10
11
12
|
# File 'app/controllers/blog_basic/app_controller.rb', line 10
def signed_in?
!session[:user_id].nil?
end
|