scinote-web/app/helpers/input_sanitize_helper.rb
2017-01-05 15:33:41 +01:00

14 lines
284 B
Ruby

module InputSanitizeHelper
def sanitize_input(text)
ActionController::Base.helpers.sanitize(
text,
tags: Constants::WHITELISTED_TAGS,
attributes: Constants::WHITELISTED_ATTRIBUTES
)
end
def escape_input(text)
ERB::Util.html_escape(text)
end
end