开发者

Rails 3. How to add files to the initialisation?

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜