Module: Login::Helper

Included in:
EditSnip, Login, NewSnip
Defined in:
lib/vanilla/dynasnips/login.rb

Instance Method Summary collapse

Instance Method Details

#current_userObject



11
12
13
# File 'lib/vanilla/dynasnips/login.rb', line 11

def current_user
  app.request.session['logged_in_as']
end

#logged_in?Boolean

Returns:

  • (Boolean)


7
8
9
# File 'lib/vanilla/dynasnips/login.rb', line 7

def logged_in?
  !current_user.nil?
end

#login_requiredObject



15
16
17
# File 'lib/vanilla/dynasnips/login.rb', line 15

def 
  "You need to <a href='/login'>login</a> to do that."
end