scinote-web/app/helpers/user_settings_helper.rb

20 lines
517 B
Ruby
Raw Normal View History

2017-02-09 18:34:52 +08:00
module UserSettingsHelper
def on_settings_account_page?
controller_name == 'registrations' && action_name == 'edit' ||
controller_name == 'preferences' && action_name == 'index'
end
def on_settings_account_profile_page?
controller_name == 'registrations'
end
def on_settings_account_preferences_page?
controller_name == 'preferences'
end
def on_settings_team_page?
controller_name.in?(%w(teams audits)) &&
action_name.in?(%w(index new create show audits_index))
2017-02-09 18:34:52 +08:00
end
end