Module: ActionView::Helpers::SanitizeHelper::ClassMethods

Defined in:
lib/rails-html-sanitizer.rb

Instance Method Summary collapse

Instance Method Details

#sanitized_allowed_attributes=(attributes) ⇒ Object

Replaces the allowed HTML attributes for the sanitize helper.

class Application < Rails::Application
  config.action_view.sanitized_allowed_attributes = ['onclick', 'longdesc']
end


46
47
48
# File 'lib/rails-html-sanitizer.rb', line 46

def sanitized_allowed_attributes=(attributes)
  sanitizer_vendor.white_list_sanitizer.allowed_attributes = attributes
end

#sanitized_allowed_tags=(tags) ⇒ Object

Replaces the allowed tags for the sanitize helper.

class Application < Rails::Application
  config.action_view.sanitized_allowed_tags = 'table', 'tr', 'td'
end


36
37
38
# File 'lib/rails-html-sanitizer.rb', line 36

def sanitized_allowed_tags=(tags)
  sanitizer_vendor.white_list_sanitizer.allowed_tags = tags
end