diff options
author | Joshua Peek <josh@joshpeek.com> | 2008-06-25 05:57:24 -0500 |
---|---|---|
committer | Joshua Peek <josh@joshpeek.com> | 2008-06-25 05:57:24 -0500 |
commit | ad772402c46a79c2d38979cef754b26dbd868196 (patch) | |
tree | ef63065744f3a7bd5a079121c613a0f0acf90c04 /actionpack/lib/action_view | |
parent | 6f5327013d6353c50cadfe2160d1b526ad687633 (diff) | |
download | rails-ad772402c46a79c2d38979cef754b26dbd868196.tar.gz rails-ad772402c46a79c2d38979cef754b26dbd868196.tar.bz2 rails-ad772402c46a79c2d38979cef754b26dbd868196.zip |
Made ActionView::Base#render_file private
Diffstat (limited to 'actionpack/lib/action_view')
-rw-r--r-- | actionpack/lib/action_view/base.rb | 40 |
1 files changed, 20 insertions, 20 deletions
diff --git a/actionpack/lib/action_view/base.rb b/actionpack/lib/action_view/base.rb index 197455a933..84f2c45f4e 100644 --- a/actionpack/lib/action_view/base.rb +++ b/actionpack/lib/action_view/base.rb @@ -228,26 +228,6 @@ module ActionView #:nodoc: @view_paths = ViewLoadPaths.new(Array(paths)) end - # Renders the template present at <tt>template_path</tt>. If <tt>use_full_path</tt> is set to true, - # 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) && 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 - - Template.new(self, template_path, use_full_path, local_assigns).render_template - end - # Renders the template present at <tt>template_path</tt> (relative to the view_paths array). # The hash in <tt>local_assigns</tt> is made available as local variables. def render(options = {}, local_assigns = {}, &block) #:nodoc: @@ -323,6 +303,26 @@ If you are rendering a subtemplate, you must now use controller-like partial syn end private + # Renders the template present at <tt>template_path</tt>. If <tt>use_full_path</tt> is set to true, + # 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) && 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 + + Template.new(self, template_path, use_full_path, local_assigns).render_template + end + def wrap_content_for_layout(content) original_content_for_layout, @content_for_layout = @content_for_layout, content yield |