module ActionView::Helpers::SanitizeHelper::ClassMethods

Public Instance Methods

sanitized_allowed_attributes=(attributes) click to toggle source

Replaces the allowed HTML attributes for the sanitize helper.

class Application < Rails::Application
  config.action_view.sanitized_allowed_attributes = ['onclick', 'longdesc']
end
# File lib/rails-html-sanitizer.rb, line 34
def sanitized_allowed_attributes=(attributes)
  sanitizer_vendor.safe_list_sanitizer.allowed_attributes = attributes
end
sanitized_allowed_tags=(tags) click to toggle source

Replaces the allowed tags for the sanitize helper.

class Application < Rails::Application
  config.action_view.sanitized_allowed_tags = 'table', 'tr', 'td'
end
# File lib/rails-html-sanitizer.rb, line 24
def sanitized_allowed_tags=(tags)
  sanitizer_vendor.safe_list_sanitizer.allowed_tags = tags
end

Private Instance Methods

deprecate_option(name) click to toggle source
# File lib/rails-html-sanitizer.rb, line 52
def deprecate_option(name)
  ActiveSupport::Deprecation.warn "The #{name} option is deprecated " \
    "and has no effect. Until Rails 5 the old behavior can still be " \
    "installed. To do this add the `rails-deprecated-sanitizer` to " \
    "your Gemfile. Consult the Rails 4.2 upgrade guide for more information."
end