demarches-normaliennes/app/helpers/application_helper.rb

21 lines
427 B
Ruby
Raw Normal View History

module ApplicationHelper
2018-01-11 18:09:01 +01:00
include SanitizeUrl
def sanitize_url(url)
super(url, schemes: ['http', 'https'], replace_evil_with: root_url)
end
def flash_class(level)
case level
when "notice" then "alert-success"
when "alert" then "alert-danger"
end
end
2017-06-22 16:45:57 +02:00
def current_email
current_user.try(:email) ||
current_gestionnaire.try(:email) ||
current_administrateur.try(:email)
end
end