SnipSnip tells you what you selected that you shouldn't have in a Rails controller action.
SnipSnip to your Gemfile:
$ gem 'snip_snip', group: %i[test development]
$ tail -f log/snip-snip.log
Hit a controller action and see the output.
The gem is available as open source under the terms of the MIT License.