Class: Blog::Gem::ApplicationController
- Inherits:
-
ApplicationController
- Object
- ApplicationController
- Blog::Gem::ApplicationController
show all
- Defined in:
- app/controllers/blog/gem/application_controller.rb
Instance Method Summary
collapse
Instance Method Details
#current_author ⇒ Object
11
12
13
14
|
# File 'app/controllers/blog/gem/application_controller.rb', line 11
def current_author
return @current_author if @current_author.present?
@current_author = Blog::Gem::Author.find_by_id(session[:author_id])
end
|
#login_as_author ⇒ Object
4
5
6
7
8
9
|
# File 'app/controllers/blog/gem/application_controller.rb', line 4
def login_as_author
current_author = Blog::Gem::Author.find_by_id(session[:author_id])
if current_author.blank?
redirect_to blogs_path
end
end
|