Module: Smithy::AuthenticationHelpers
- Defined in:
- lib/smithy/authentication_helpers.rb
Class Method Summary collapse
Instance Method Summary collapse
- #current_user ⇒ Object
- #smithy_current_user ⇒ Object
- #smithy_login_path ⇒ Object
- #smithy_logout_path ⇒ Object
Class Method Details
.included(receiver) ⇒ Object
3 4 5 6 7 8 |
# File 'lib/smithy/authentication_helpers.rb', line 3 def self.included(receiver) receiver.send :helper_method, :current_user receiver.send :helper_method, :smithy_current_user receiver.send :helper_method, :smithy_login_path receiver.send :helper_method, :smithy_logout_path end |
Instance Method Details
#current_user ⇒ Object
10 11 12 |
# File 'lib/smithy/authentication_helpers.rb', line 10 def current_user @current_user ||= Smithy::User.find(session[:user_id]) if session[:user_id] end |
#smithy_current_user ⇒ Object
14 15 16 |
# File 'lib/smithy/authentication_helpers.rb', line 14 def smithy_current_user current_user end |
#smithy_login_path ⇒ Object
18 19 20 |
# File 'lib/smithy/authentication_helpers.rb', line 18 def smithy_login_path smithy.login_path end |
#smithy_logout_path ⇒ Object
22 23 24 |
# File 'lib/smithy/authentication_helpers.rb', line 22 def smithy_logout_path smithy.logout_path end |