Install plugin view paths into AM view load path

This commit is contained in:
Joshua Peek
2010-01-18 16:48:04 -06:00
parent 59cd044310
commit f2693cda44

View File

@@ -50,7 +50,11 @@ module Rails
end
initializer :add_view_paths, :after => :initialize_framework_views do
ActionController::Base.view_paths.concat ["#{path}/app/views"] if File.directory?("#{path}/app/views")
plugin_views = "#{path}/app/views"
if File.directory?(plugin_views)
ActionController::Base.view_paths.concat([plugin_views]) if defined? ActionController
ActionMailer::Base.view_paths.concat([plugin_views]) if defined? ActionMailer
end
end
# TODO Isn't it supposed to be :after => "action_controller.initialize_routing" ?
@@ -62,4 +66,4 @@ module Rails
end
end
end
end
end