2010-08-06 10:34:48 -04:00
|
|
|
module ActionController
|
|
|
|
module Railties
|
|
|
|
module Paths
|
2010-08-23 13:25:04 -04:00
|
|
|
def self.with(app)
|
2010-08-06 10:34:48 -04:00
|
|
|
Module.new do
|
|
|
|
define_method(:inherited) do |klass|
|
|
|
|
super(klass)
|
2010-10-06 11:18:59 -04:00
|
|
|
|
2010-08-06 10:34:48 -04:00
|
|
|
if namespace = klass.parents.detect {|m| m.respond_to?(:_railtie) }
|
2010-10-06 11:18:59 -04:00
|
|
|
paths = namespace._railtie.paths["app/helpers"].existent
|
2010-08-06 10:34:48 -04:00
|
|
|
else
|
2010-10-06 11:18:59 -04:00
|
|
|
paths = app.config.helpers_paths
|
2010-08-06 10:34:48 -04:00
|
|
|
end
|
|
|
|
|
2010-10-06 11:18:59 -04:00
|
|
|
klass.helpers_path = paths
|
2010-11-17 18:06:03 -05:00
|
|
|
if klass.superclass == ActionController::Base && ActionController::Base.include_all_helpers
|
|
|
|
klass.helper :all
|
|
|
|
end
|
2010-08-06 10:34:48 -04:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|