19

In rails, when creating an initializer, is it as simple as adding a file to the config/initializer director or do I need to make changes elsewhere?

I'm asking because I keep getting errors every time I create an initializer for gems...and not sure if it's because I'm missing a step in creating initializers.

user749798
  • 5,210
  • 10
  • 51
  • 85

2 Answers2

23

initializers are just files in config/initializers there is no other magic

Frederick Cheung
  • 83,189
  • 8
  • 152
  • 174
  • 3
    when you add a new initializer you'll also need to restart your local server, just a simple browser refresh will not pull in the newly created initializer. – Jordan Nov 15 '16 at 21:16
0

If you're using a plugin or gem though, you may need to explicitly "request" or "require" the plugin in your controllers too...in that case, you'll just need to look at the documentation.