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

Creating draft posts in Jekyll

How to create and develop with draft posts in Jekyll

Ruby

Forcing a Rails database column to be not null

How you can force a table column to always have something in it with Rails