aboutsummaryrefslogtreecommitdiffstats
path: root/railties
diff options
context:
space:
mode:
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