Rails loads controllers, helpers, and models for every request.
My controllers have tons of modules that include methods for common actions.
Every time I change modules, I have to restart Rails for changes in the actions that will take effect
Any idea how I can say that rails also reload these modules?
Update:
My directory structure looks like this:
app /
controllers /
app1 /
users_controller.rb
app2 /
users_controller.rb
lib /
templates /
controllers /
users_controller_template.rb
Both App1 :: UsersController and App2 :: UsersController load UsersControllerTeplate as follows:
class App1::UsersController < App1::ApplicationController
require "templates/controllers/users_controller_template"
include Templates::Controllers::UsersControllerTemplate
end
module Templates::Controllers::UsersControllerTemplate
def self.included(base)
base.class_eval do
end
end
def index
end
end
In application.rb, I added:
config.autoload_paths += %W{
, , users_controller_template.rb
?