Module: CoreApplicationHelper

Defined in:
app/helpers/core_application_helper.rb

Overview

Helpers for the application itself

Instance Method Summary collapse

Instance Method Details

#current_memberMember?

This method is abstract.

Return the current member

Returns - The current user that is logged in.

Returns:

  • (Member, nil)
    • The current user that is logged in



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

def current_member
  @current_member
end

#current_member_userMember, ...

This method is abstract.

return the user or member depending on configuration

Returns:

  • (Member, User, nil)


21
22
23
24
25
# File 'app/helpers/core_application_helper.rb', line 21

def current_member_user
  send("current_#{Web47core.audit_model}")
rescue StandardError
  current_user || current_member
end

#current_userUser?

This method is abstract.

Return the current user

Returns - The current user that is logged in.

Returns:

  • (User, nil)
    • The current user that is logged in



9
10
11
# File 'app/helpers/core_application_helper.rb', line 9

def current_user
  @current_user
end

#referrer_url(default_url) ⇒ String

This method is abstract.

Return the referrer url without deleting it out of the session

Returns the session or the default_url if not found.

Parameters:

  • default_url (String)
    • The URL to use if the referrer session is not there

Returns:

  • (String)

    the session or the default_url if not found



30
31
32
# File 'app/helpers/core_application_helper.rb', line 30

def referrer_url(default_url)
  session[:referrer] || default_url
end