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


Testing Routes with RSpec

Testing routes can give you more confidence and help drive application development; here is how to do it with RSpec


How to ignore Bullet in RSpec tests

Using Bullet during a test can pick up mistakes but also has false negatives; here is an easy way to ignore them