Though not verified in practice, here is a solution.
According to README, you can set the following in initializer to remove special characters in tag name:
ActsAsTaggableOn.force_parameterize = true
It seems acts_as_taggable_on doesn't have an installation command and a default initializer. You can put above setting in any file in /initializers/
, and preferred a new file dedicated to this gem.
By setting that, all of your tag name inputs will be processed after saving like
my_string.parameterize
Test
"radical)(cc".parameterize
#=> "radical-cc"
"#Happy".parameterize
#=> "happy"