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

Defined in:
lib/action_view/helpers/sanitize_helper.rb

Overview

:nodoc:

Instance Attribute Summary collapse

Instance Method Summary collapse

Instance Attribute Details

#full_sanitizerObject

Gets the Rails::Html::FullSanitizer instance used by strip_tags. Replace with any object that responds to sanitize.

class Application < Rails::Application
  config.action_view.full_sanitizer = MySpecialSanitizer.new
end


147
148
149
# File 'lib/action_view/helpers/sanitize_helper.rb', line 147

def full_sanitizer
  @full_sanitizer ||= sanitizer_vendor.full_sanitizer.new
end

Gets the Rails::Html::LinkSanitizer instance used by strip_links. Replace with any object that responds to sanitize.

class Application < Rails::Application
  config.action_view.link_sanitizer = MySpecialSanitizer.new
end


158
159
160
# File 'lib/action_view/helpers/sanitize_helper.rb', line 158

def link_sanitizer
  @link_sanitizer ||= sanitizer_vendor.link_sanitizer.new
end

#white_list_sanitizerObject

Gets the Rails::Html::WhiteListSanitizer instance used by sanitize and sanitize_css. Replace with any object that responds to sanitize.

class Application < Rails::Application
  config.action_view.white_list_sanitizer = MySpecialSanitizer.new
end


169
170
171
# File 'lib/action_view/helpers/sanitize_helper.rb', line 169

def white_list_sanitizer
  @white_list_sanitizer ||= sanitizer_vendor.white_list_sanitizer.new
end

Instance Method Details

#sanitized_allowed_attributesObject



136
137
138
# File 'lib/action_view/helpers/sanitize_helper.rb', line 136

def sanitized_allowed_attributes
  sanitizer_vendor.white_list_sanitizer.allowed_attributes
end

#sanitized_allowed_tagsObject



132
133
134
# File 'lib/action_view/helpers/sanitize_helper.rb', line 132

def sanitized_allowed_tags
  sanitizer_vendor.white_list_sanitizer.allowed_tags
end

#sanitizer_vendorObject

Vendors the full, link and white list sanitizers. Provided strictly for compatibility and can be removed in Rails 5.1.



128
129
130
# File 'lib/action_view/helpers/sanitize_helper.rb', line 128

def sanitizer_vendor
  Rails::Html::Sanitizer
end