Module: SessionsHelper

Defined in:
app/helpers/sessions_helper.rb

Instance Method Summary collapse

Instance Method Details

#display_password_reset_link?Boolean


15
16
17
# File 'app/helpers/sessions_helper.rb', line 15

def display_password_reset_link?
  devise_mapping.recoverable? && controller_name != 'passwords'
end

#display_registration_link?Boolean


11
12
13
# File 'app/helpers/sessions_helper.rb', line 11

def display_registration_link?
  AppConfig.settings.enable_registrations? && devise_mapping.registerable? && controller_name != 'registrations'
end

#prefilled_usernameObject


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

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