提交 f2693cda 编写于 作者: J Joshua Peek

Install plugin view paths into AM view load path

上级 59cd0443
......@@ -50,7 +50,11 @@ def load_tasks
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 @@ def load_tasks
end
end
end
end
\ No newline at end of file
end
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册