Class: ApplicationController

Inherits:
ActionController::Base
  • Object
show all
Defined in:
lib/ecrire/app/controllers/application_controller.rb

Instance Method Summary collapse

Instance Method Details

#current_userObject



8
9
10
# File 'lib/ecrire/app/controllers/application_controller.rb', line 8

def current_user
  warden.user
end

#postsObject



16
17
18
# File 'lib/ecrire/app/controllers/application_controller.rb', line 16

def posts
  @posts ||= Post.all
end

#signed_in?Boolean

Returns:

  • (Boolean)


12
13
14
# File 'lib/ecrire/app/controllers/application_controller.rb', line 12

def signed_in?
  !warden.user.nil?
end