Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Where do I place the configuration for Act-as-taggable-on?

I'm reading the act-as-taggable Github document, https://github.com/mbleigh/acts-as-taggable-on, and I want to force tags to be saved downcase. The instruction in the Configuration section says to add the line

ActsAsTaggableOn.force_lowercase = true

but I'm not quite sure where this would go.

In what file am I supposed to put this piece of code?

Thanks!

like image 368
Huy Avatar asked Apr 26 '12 00:04

Huy


1 Answers

You can create a custom initializer in config/initializers and put this line there.

Or alternatively, you can set this in config/application.rb:

module YourApp
  class Application < Rails::Application
    ActsAsTaggableOn.force_lowercase = true
  end
end
like image 130
NARKOZ Avatar answered Nov 15 '22 16:11

NARKOZ