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


181
182
183
# File 'lib/action_view/helpers/sanitize_helper.rb', line 181

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


191
192
193
# File 'lib/action_view/helpers/sanitize_helper.rb', line 191

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

#safe_list_sanitizerObject

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

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


201
202
203
# File 'lib/action_view/helpers/sanitize_helper.rb', line 201

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

Instance Method Details

#sanitized_allowed_attributesObject



171
172
173
# File 'lib/action_view/helpers/sanitize_helper.rb', line 171

def sanitized_allowed_attributes
  sanitizer_vendor.safe_list_sanitizer.allowed_attributes
end

#sanitized_allowed_tagsObject



167
168
169
# File 'lib/action_view/helpers/sanitize_helper.rb', line 167

def sanitized_allowed_tags
  sanitizer_vendor.safe_list_sanitizer.allowed_tags
end

#sanitizer_vendorObject



163
164
165
# File 'lib/action_view/helpers/sanitize_helper.rb', line 163

def sanitizer_vendor
  ActionView::Helpers::SanitizeHelper.sanitizer_vendor
end