Class: Blog::Gem::ApplicationController

Inherits:
ApplicationController
  • Object
show all
Defined in:
app/controllers/blog/gem/application_controller.rb

Instance Method Summary collapse

Instance Method Details

#current_authorObject



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_authorObject



4
5
6
7
8
9
# File 'app/controllers/blog/gem/application_controller.rb', line 4

def 
  current_author = Blog::Gem::Author.find_by_id(session[:author_id])
  if current_author.blank?
    redirect_to blogs_path
  end
end