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


50
51
52
# File 'lib/rails-html-sanitizer.rb', line 50

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


40
41
42
# File 'lib/rails-html-sanitizer.rb', line 40

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