aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorRick Olson <technoweenie@gmail.com>2007-11-26 03:35:52 +0000
committerRick Olson <technoweenie@gmail.com>2007-11-26 03:35:52 +0000
commit3d67860cae0898b248381075d98736ff77d671dd (patch)
treed4a241343d19aa32e69f0a427620866dd1887f93 /actionpack/lib
parent8afb4e136b2482e1e3826d3e00981b4b89680e1a (diff)
downloadrails-3d67860cae0898b248381075d98736ff77d671dd.tar.gz
rails-3d67860cae0898b248381075d98736ff77d671dd.tar.bz2
rails-3d67860cae0898b248381075d98736ff77d671dd.zip
Add deprecation for old subtemplate syntax for ActionMailer templates, use render :partial [rick]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@8211 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_view/base.rb13
1 files changed, 13 insertions, 0 deletions
diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb
index d73fb643e8..9901f81d56 100644
--- a/actionpack/lib/action_view/base.rb
+++ b/actionpack/lib/action_view/base.rb
@@ -276,6 +276,19 @@ module ActionView #:nodoc:
# it's relative to the view_paths array, otherwise it's absolute. The hash in <tt>local_assigns</tt>
# is made available as local variables.
def render_file(template_path, use_full_path = true, local_assigns = {}) #:nodoc:
+ if defined?(ActionMailer::Base) && controller.is_a?(ActionMailer::Base) && !template_path.include?("/")
+ raise ActionViewError, <<-END_ERROR
+Due to changes in ActionMailer, you need to provide the mailer_name along with the template name.
+
+ render "user_mailer/signup"
+ render :file => "user_mailer/signup"
+
+If you are rendering a subtemplate, you must now use controller-like partial syntax:
+
+ render :partial => 'signup' # no mailer_name necessary
+ END_ERROR
+ end
+
@first_render ||= template_path
template_path_without_extension, template_extension = path_and_extension(template_path)
if use_full_path