Adding a directory to the load path in Rails?

后端 未结 8 1042
囚心锁ツ
囚心锁ツ 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条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-04 14:41

    I found I needed to do this after config block-- no access to config object anymore.

    This did the trick

    ActiveSupport::Dependencies.load_paths << "#{RAILS_ROOT}/app/widgets"
    

提交回复
热议问题