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


34
35
36
# 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) ⇒ Object

Replaces the allowed tags for the sanitize helper.

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


24
25
26
# File 'lib/rails-html-sanitizer.rb', line 24

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