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
. -
#white_list_sanitizer ⇒ Object
Gets the Rails::Html::WhiteListSanitizer instance used by sanitize and
sanitize_css
.
Instance Method Summary collapse
- #sanitized_allowed_attributes ⇒ Object
- #sanitized_allowed_tags ⇒ Object
-
#sanitizer_vendor ⇒ Object
Vendors the full, link and white list sanitizers.
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
144 145 146 |
# File 'lib/action_view/helpers/sanitize_helper.rb', line 144 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
155 156 157 |
# File 'lib/action_view/helpers/sanitize_helper.rb', line 155 def link_sanitizer @link_sanitizer ||= sanitizer_vendor.link_sanitizer.new end |
#white_list_sanitizer ⇒ Object
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
166 167 168 |
# File 'lib/action_view/helpers/sanitize_helper.rb', line 166 def white_list_sanitizer @white_list_sanitizer ||= sanitizer_vendor.white_list_sanitizer.new end |
Instance Method Details
#sanitized_allowed_attributes ⇒ Object
133 134 135 |
# File 'lib/action_view/helpers/sanitize_helper.rb', line 133 def sanitized_allowed_attributes sanitizer_vendor.white_list_sanitizer.allowed_attributes end |
#sanitized_allowed_tags ⇒ Object
129 130 131 |
# File 'lib/action_view/helpers/sanitize_helper.rb', line 129 def sanitizer_vendor.white_list_sanitizer. end |
#sanitizer_vendor ⇒ Object
Vendors the full, link and white list sanitizers. Provided strictly for compabitility and can be removed in Rails 5.
125 126 127 |
# File 'lib/action_view/helpers/sanitize_helper.rb', line 125 def sanitizer_vendor Rails::Html::Sanitizer end |