Action Text Sanitizer update to more inclusive language

How I went about updating my Action Text allowed tags/attributes

Now that we are rightly as a community removing references in Rails to language such as blacklist and whitelist, I thought I would share how I updated my action_text.rb file to use more inclusive terms that are now available in Rails.

Before I had to use:

Rails::Html::WhiteListSanitizer.allowed_tags << 'iframe’

And this is now able to be:

Rails::Html::Sanitizer.safe_list_sanitizer.allowed_tags << 'iframe’

You may find that if you update Rubocop you will be alerted to Naming/InclusiveLanguage: Consider replacing problematic term 'WhiteList' with 'allowlist' or 'permit’. in this file.


Recent posts View all

Web Dev

Updating payment method email addresses in Stripe

You can't update the email address associated with a payment method in Stripe via their dashboard, you need to use the Stripe CLI

Ruby

Irreversible Rails Migrations

What are irreversible migrations and how might we use them to our advantage?