Module: Layered::Ui::AuthenticationHelper
- Defined in:
- app/helpers/layered/ui/authentication_helper.rb
Instance Method Summary collapse
- #l_ui_current_user ⇒ Object
- #l_ui_destroy_session_path ⇒ Object
- #l_ui_devise_installed? ⇒ Boolean
- #l_ui_edit_registration_path ⇒ Object
- #l_ui_new_registration_path ⇒ Object
- #l_ui_new_session_path ⇒ Object
-
#l_ui_settings_screen? ⇒ Boolean
True on the account settings screen (Devise's registrations#edit).
- #l_ui_user_signed_in? ⇒ Boolean
Instance Method Details
#l_ui_current_user ⇒ Object
8 9 10 11 |
# File 'app/helpers/layered/ui/authentication_helper.rb', line 8 def l_ui_current_user method = Layered::Ui.current_user_method send(method) if respond_to?(method, true) end |
#l_ui_destroy_session_path ⇒ Object
36 37 38 |
# File 'app/helpers/layered/ui/authentication_helper.rb', line 36 def l_ui_destroy_session_path l_ui_devise_path(:destroy, :session) end |
#l_ui_devise_installed? ⇒ Boolean
4 5 6 |
# File 'app/helpers/layered/ui/authentication_helper.rb', line 4 def l_ui_devise_installed? defined?(Devise) end |
#l_ui_edit_registration_path ⇒ Object
28 29 30 |
# File 'app/helpers/layered/ui/authentication_helper.rb', line 28 def l_ui_edit_registration_path l_ui_devise_path(:edit, :registration) end |
#l_ui_new_registration_path ⇒ Object
24 25 26 |
# File 'app/helpers/layered/ui/authentication_helper.rb', line 24 def l_ui_new_registration_path l_ui_devise_path(:new, :registration) end |
#l_ui_new_session_path ⇒ Object
32 33 34 |
# File 'app/helpers/layered/ui/authentication_helper.rb', line 32 def l_ui_new_session_path l_ui_devise_path(:new, :session) end |
#l_ui_settings_screen? ⇒ Boolean
True on the account settings screen (Devise's registrations#edit). Layouts that strip app chrome from Devise views want an exception for it, as it is part of the signed-in app rather than the authentication flow.
20 21 22 |
# File 'app/helpers/layered/ui/authentication_helper.rb', line 20 def l_ui_settings_screen? controller_name == "registrations" && action_name == "edit" end |
#l_ui_user_signed_in? ⇒ Boolean
13 14 15 |
# File 'app/helpers/layered/ui/authentication_helper.rb', line 13 def l_ui_user_signed_in? l_ui_current_user.present? end |