如果您一直在寻求由 environment.rb 读取前对 Rails 程序进行设置的方式,今天有 答案 了。
如果一个 config/preinitializer.rb 的文件存在,Rails 将在读取 environment.rb 文件之前先加载这个文件。通过这个方法使您在加载插件之前可以使程序读取 Rails 的类代码。
原文作者是 Ryan Daigle, 请访问他的博客 本片译文的原文地址:Track
Leave a response
Name:
Email Address:
Website:
Comment:
My name is Yudi, and this is my blog.
It will be written in Engilsh and Chinese, which are two of the most beautiful languages in the world.
Here is my photo gallery | 相册
Technorati Profile
yudi (at) yudionrails (dot) com
Some Rights Reserved
保留部分权利