Adding a directory to the load path in Rails?

后端 未结 8 1040
囚心锁ツ
囚心锁ツ 2020-12-04 14:25

As of Rails 2.3, what\'s the right way to add a directory to the load path so that it hooks into Rails\' auto-reloading mechanisms?

The specific example I\'m thinkin

8条回答
  •  醉酒成梦
    2020-12-04 14:45

    For older versions of Rails:

    You can do this in your environment.rb config file.

    config.load_paths << "#{RAILS_ROOT}/app/widgets"
    

    --

    For Rails 3, see answers bellow

提交回复
热议问题