更新时间:2023-11-30 17:14:40
这就是lib"文件夹的用途.
This is what the 'lib' folder is for.
lib 文件夹在自动查找的路径中,所以你可以有
The lib folder is in the automatically looked up path, so you can have
class MyFoo
end
在 lib/my_foo.rb
中,然后只需调用
in lib/my_foo.rb
and then just by calling
MyFoo.new
从控制器加载代码,不需要 require 'my_foo'
from a controller the code will be loaded without you needing a require 'my_foo'