Module: ActionView::Helpers::SanitizeHelper::ClassMethods
- Defined in:
- lib/action_view/helpers/sanitize_helper.rb
Overview
:nodoc:
Instance Attribute Summary collapse
-
#full_sanitizer ⇒ Object
Gets the Rails::HTML::FullSanitizer instance used by
strip_tags
. -
#link_sanitizer ⇒ Object
Gets the Rails::HTML::LinkSanitizer instance used by
strip_links
. -
#safe_list_sanitizer ⇒ Object
Gets the Rails::HTML::SafeListSanitizer instance used by sanitize and
sanitize_css
.
Instance Method Summary collapse
Instance Attribute Details
#full_sanitizer ⇒ Object
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
164 165 166 |
# File 'lib/action_view/helpers/sanitize_helper.rb', line 164 def full_sanitizer @full_sanitizer ||= sanitizer_vendor.full_sanitizer.new end |
#link_sanitizer ⇒ Object
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
174 175 176 |
# File 'lib/action_view/helpers/sanitize_helper.rb', line 174 def link_sanitizer @link_sanitizer ||= sanitizer_vendor.link_sanitizer.new end |
#safe_list_sanitizer ⇒ Object
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
184 185 186 |
# File 'lib/action_view/helpers/sanitize_helper.rb', line 184 def safe_list_sanitizer @safe_list_sanitizer ||= sanitizer_vendor.safe_list_sanitizer.new end |
Instance Method Details
#sanitized_allowed_attributes ⇒ Object
154 155 156 |
# File 'lib/action_view/helpers/sanitize_helper.rb', line 154 def sanitized_allowed_attributes sanitizer_vendor.safe_list_sanitizer.allowed_attributes end |
#sanitized_allowed_tags ⇒ Object
150 151 152 |
# File 'lib/action_view/helpers/sanitize_helper.rb', line 150 def sanitizer_vendor.safe_list_sanitizer. end |
#sanitizer_vendor ⇒ Object
146 147 148 |
# File 'lib/action_view/helpers/sanitize_helper.rb', line 146 def sanitizer_vendor ActionView::Helpers::SanitizeHelper.sanitizer_vendor end |