Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Install plugin view paths into AM view load path

  • Loading branch information...
commit f2693cda446dc039e52eee43b60346689850bb76 1 parent 59cd044
@josh josh authored
Showing with 6 additions and 2 deletions.
  1. +6 −2 railties/lib/rails/plugin.rb
View
8 railties/lib/rails/plugin.rb
@@ -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
+end
Please sign in to comment.
Something went wrong with that request. Please try again.