Created
January 5, 2016 02:31
-
-
Save spalenza/0ac4ac85f95df2f43c06 to your computer and use it in GitHub Desktop.
Namespace stuff in your app/ folder
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# config/initializers/forms.rb | |
Rails.application.config.to_prepare do | |
path = Rails.root + "app/forms" | |
ActiveSupport::Dependencies.autoload_paths -= [path.to_s] | |
reloader = ActiveSupport::FileUpdateChecker.new [], path.to_s => [:rb] do | |
ActiveSupport::DescendantsTracker.clear | |
ActiveSupport::Dependencies.clear | |
Dir[path + "**/*.rb"].each do |file| | |
ActiveSupport.require_or_load file | |
end | |
end | |
Rails.application.reloaders << reloader | |
ActionDispatch::Reloader.to_prepare { reloader.execute_if_updated } | |
reloader.execute | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment