Module: SessionsHelper

Defined in:
app/helpers/sessions_helper.rb

Instance Method Summary collapse

Instance Method Details

#display_password_reset_link?Boolean

Returns:

  • (Boolean)

17
18
19
# File 'app/helpers/sessions_helper.rb', line 17

def display_password_reset_link?
  AppConfig.mail.enable? && devise_mapping.recoverable? && controller_name != "passwords"
end

#display_registration_link?Boolean

Returns:

  • (Boolean)

13
14
15
# File 'app/helpers/sessions_helper.rb', line 13

def display_registration_link?
  AppConfig.settings.enable_registrations? && controller_name != "registrations"
end

#flash_class(name) ⇒ Object


21
22
23
# File 'app/helpers/sessions_helper.rb', line 21

def flash_class(name)
  {notice: "success", alert: "danger", error: "danger"}[name.to_sym]
end

#prefilled_usernameObject


4
5
6
7
8
9
10
11
# File 'app/helpers/sessions_helper.rb', line 4

def prefilled_username
  uri = Addressable::URI.parse(session["user_return_to"])
  if uri && uri.query_values
    uri.query_values["username"]
  else
    nil
  end
end