Module: Layered::Ui::AuthenticationHelper

Defined in:
app/helpers/layered/ui/authentication_helper.rb

Instance Method Summary collapse

Instance Method Details

#l_ui_current_userObject



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_pathObject



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

Returns:

  • (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_pathObject



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_pathObject



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_pathObject



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.

Returns:

  • (Boolean)


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

Returns:

  • (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