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


52
53
54
# File 'lib/rails-html-sanitizer.rb', line 52

def sanitized_allowed_attributes=(attributes)
  sanitizer_vendor.safe_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


42
43
44
# File 'lib/rails-html-sanitizer.rb', line 42

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