开发者

Rails 3. How to add files to the initialisation?

开发者 https://www.devze.com 2023-02-07 03:01 出处:网络
I was wondering how you added files to be included in the initialisation of a rails app. At the moment开发者_StackOverflow I\'m keeping a few files in the model folder because I know the are includi

I was wondering how you added files to be included in the initialisation of a rails app.

At the moment开发者_StackOverflow I'm keeping a few files in the model folder because I know the are including.

How do you specify any file to be included, I would rather the files are in lib folder.


You can autoload /lib folder by adding this line to config/application.rb:

config.autoload_paths += %W(#{config.root}/lib)

It's probably just commented now.

But if all you need is just some simple app configuring, put it in config/initializers like John said.


Put them in the config/initializers directory.

0

精彩评论

暂无评论...
验证码 换一张
取 消