aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
authorJoshua Peek <josh@joshpeek.com>2010-01-18 16:48:04 -0600
committerJoshua Peek <josh@joshpeek.com>2010-01-18 16:48:04 -0600
commitf2693cda446dc039e52eee43b60346689850bb76 (patch)
tree1e815b9c21419dc8e17bd07156363a708dda9acc /railties
parent59cd044310d4bb454d492addffb8bd60dd8a23a9 (diff)
downloadrails-f2693cda446dc039e52eee43b60346689850bb76.tar.gz
rails-f2693cda446dc039e52eee43b60346689850bb76.tar.bz2
rails-f2693cda446dc039e52eee43b60346689850bb76.zip
Install plugin view paths into AM view load path
Diffstat (limited to 'railties')
-rw-r--r--railties/lib/rails/plugin.rb8
1 files changed, 6 insertions, 2 deletions
diff --git a/railties/lib/rails/plugin.rb b/railties/lib/rails/plugin.rb
index a057b8f701..0c09730963 100644
--- a/railties/lib/rails/plugin.rb
+++ b/railties/lib/rails/plugin.rb
@@ -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 \ No newline at end of file
+end