Class: Decidim::NewsletterScrubber
- Inherits:
-
Rails::Html::PermitScrubber
- Object
- Rails::Html::PermitScrubber
- Decidim::NewsletterScrubber
- Defined in:
- app/scrubbers/decidim/newsletter_scrubber.rb
Overview
Use this class as a scrubber to sanitize user input. The default scrubbed provided by Rails does not allow ‘iframe`s, and we’re using them to embed videos, so we need to provide a whole new scrubber.
Example:
sanitize(@page.body, scrubber: Decidim::UserInputScrubber.new)
Lists of default tags and attributes are extracted from stackoverflow.com/a/35073814/2110884.
Instance Method Summary collapse
-
#initialize ⇒ NewsletterScrubber
constructor
A new instance of NewsletterScrubber.
Constructor Details
#initialize ⇒ NewsletterScrubber
Returns a new instance of NewsletterScrubber.
15 16 17 18 19 |
# File 'app/scrubbers/decidim/newsletter_scrubber.rb', line 15 def initialize super self. = self.attributes = custom_allowed_attributes end |