<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -780,9 +780,6 @@ module ActionController #:nodoc:
       #   render :file =&gt; &quot;/path/to/some/template.erb&quot;, :layout =&gt; true, :status =&gt; 404
       #   render :file =&gt; &quot;c:/path/to/some/template.erb&quot;, :layout =&gt; true, :status =&gt; 404
       #
-      #   # Renders a template relative to the template root and chooses the proper file extension
-      #   render :file =&gt; &quot;some/template&quot;, :use_full_path =&gt; true
-      #
       # === Rendering text
       #
       # Rendering of text is usually used for tests or for rendering prepared content, such as a cache. By default, text
@@ -913,21 +910,10 @@ module ActionController #:nodoc:
             response.content_type ||= Mime::JSON
             render_for_text(json, options[:status])
 
-          elsif partial = options[:partial]
-            partial = default_template_name if partial == true
+          elsif options[:partial]
+            options[:partial] = default_template_name if options[:partial] == true
             add_variables_to_assigns
-
-            if collection = options[:collection]
-              render_for_text(
-                @template.send!(:render_partial_collection, partial, collection,
-                options[:spacer_template], options[:locals], options[:as]), options[:status]
-              )
-            else
-              render_for_text(
-                @template.send!(:render_partial, partial,
-                options[:object], options[:locals]), options[:status]
-              )
-            end
+            render_for_text(@template.render(options), options[:status])
 
           elsif options[:update]
             add_variables_to_assigns</diff>
      <filename>actionpack/lib/action_controller/base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -182,7 +182,7 @@ module ActionController #:nodoc:
         @template.instance_variable_set(&quot;@rescues_path&quot;, File.dirname(rescues_path(&quot;stub&quot;)))
         @template.send!(:assign_variables_from_controller)
 
-        @template.instance_variable_set(&quot;@contents&quot;, @template.render(:file =&gt; template_path_for_local_rescue(exception), :use_full_path =&gt; false))
+        @template.instance_variable_set(&quot;@contents&quot;, @template.render(:file =&gt; template_path_for_local_rescue(exception)))
 
         response.content_type = Mime::HTML
         render_for_file(rescues_path(&quot;layout&quot;), response_code_for_rescue(exception))</diff>
      <filename>actionpack/lib/action_controller/rescue.rb</filename>
    </modified>
    <modified>
      <diff>@@ -6,6 +6,6 @@
 &lt;/h1&gt;
 &lt;pre&gt;&lt;%=h @exception.clean_message %&gt;&lt;/pre&gt;
 
-&lt;%= render(:file =&gt; @rescues_path + &quot;/_trace.erb&quot;, :use_full_path =&gt; false) %&gt;
+&lt;%= render(:file =&gt; @rescues_path + &quot;/_trace.erb&quot;) %&gt;
 
-&lt;%= render(:file =&gt; @rescues_path + &quot;/_request_and_response.erb&quot;, :use_full_path =&gt; false) %&gt;
+&lt;%= render(:file =&gt; @rescues_path + &quot;/_request_and_response.erb&quot;) %&gt;</diff>
      <filename>actionpack/lib/action_controller/templates/rescues/diagnostics.erb</filename>
    </modified>
    <modified>
      <diff>@@ -15,7 +15,7 @@
 
 &lt;% @real_exception = @exception
    @exception = @exception.original_exception || @exception %&gt;
-&lt;%= render(:file =&gt; @rescues_path + &quot;/_trace.erb&quot;, :use_full_path =&gt; false) %&gt;
+&lt;%= render(:file =&gt; @rescues_path + &quot;/_trace.erb&quot;) %&gt;
 &lt;% @exception = @real_exception %&gt;
 
-&lt;%= render(:file =&gt; @rescues_path + &quot;/_request_and_response.erb&quot;, :use_full_path =&gt; false) %&gt;
+&lt;%= render(:file =&gt; @rescues_path + &quot;/_request_and_response.erb&quot;) %&gt;</diff>
      <filename>actionpack/lib/action_controller/templates/rescues/template_error.erb</filename>
    </modified>
    <modified>
      <diff>@@ -239,7 +239,7 @@ module ActionView #:nodoc:
       local_assigns ||= {}
 
       if options.is_a?(String)
-        render_file(options, nil, local_assigns)
+        render(:file =&gt; options, :locals =&gt; local_assigns)
       elsif options == :update
         update_page(&amp;block)
       elsif options.is_a?(Hash)
@@ -262,13 +262,15 @@ module ActionView #:nodoc:
             end
           end
         elsif options[:file]
-          render_file(options[:file], nil, options[:locals])
-        elsif options[:partial] &amp;&amp; options.has_key?(:collection)
-          render_partial_collection(options[:partial], options[:collection], options[:spacer_template], options[:locals], options[:as])
+          if options[:use_full_path]
+            ActiveSupport::Deprecation.warn(&quot;use_full_path option has been deprecated and has no affect.&quot;, caller)
+          end
+
+          pick_template(options[:file]).render_template(self, options[:locals])
         elsif options[:partial]
-          render_partial(options[:partial], options[:object], options[:locals])
+          render_partial(options)
         elsif options[:inline]
-          render_inline(options[:inline], options[:locals], options[:type])
+          InlineTemplate.new(options[:inline], options[:type]).render(self, options[:locals])
         end
       end
     end
@@ -345,35 +347,6 @@ module ActionView #:nodoc:
     memoize :pick_template
 
     private
-      # Renders the template present at &lt;tt&gt;template_path&lt;/tt&gt;. The hash in &lt;tt&gt;local_assigns&lt;/tt&gt;
-      # is made available as local variables.
-      def render_file(template_path, use_full_path = nil, local_assigns = {}) #:nodoc:
-        unless use_full_path == nil
-          ActiveSupport::Deprecation.warn(&quot;use_full_path option has been deprecated and has no affect.&quot;, caller)
-        end
-
-        if defined?(ActionMailer) &amp;&amp; defined?(ActionMailer::Base) &amp;&amp; controller.is_a?(ActionMailer::Base) &amp;&amp;
-            template_path.is_a?(String) &amp;&amp; !template_path.include?(&quot;/&quot;)
-          raise ActionViewError, &lt;&lt;-END_ERROR
-  Due to changes in ActionMailer, you need to provide the mailer_name along with the template name.
-
-    render &quot;user_mailer/signup&quot;
-    render :file =&gt; &quot;user_mailer/signup&quot;
-
-  If you are rendering a subtemplate, you must now use controller-like partial syntax:
-
-    render :partial =&gt; 'signup' # no mailer_name necessary
-          END_ERROR
-        end
-
-        template = pick_template(template_path)
-        template.render_template(self, local_assigns)
-      end
-
-      def render_inline(text, local_assigns = {}, type = nil)
-        InlineTemplate.new(text, type).render(self, local_assigns)
-      end
-
       # Evaluate the local assigns and pushes them to the view.
       def evaluate_assigns
         unless @assigns_added</diff>
      <filename>actionpack/lib/action_view/base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,14 +1,15 @@
 module ActionView
-  # There's also a convenience method for rendering sub templates within the current controller that depends on a single object
-  # (we call this kind of sub templates for partials). It relies on the fact that partials should follow the naming convention of being
-  # prefixed with an underscore -- as to separate them from regular templates that could be rendered on their own.
+  # There's also a convenience method for rendering sub templates within the current controller that depends on a
+  # single object (we call this kind of sub templates for partials). It relies on the fact that partials should
+  # follow the naming convention of being prefixed with an underscore -- as to separate them from regular
+  # templates that could be rendered on their own.
   #
   # In a template for Advertiser#account:
   #
   #  &lt;%= render :partial =&gt; &quot;account&quot; %&gt;
   #
-  # This would render &quot;advertiser/_account.erb&quot; and pass the instance variable @account in as a local variable +account+ to
-  # the template for display.
+  # This would render &quot;advertiser/_account.erb&quot; and pass the instance variable @account in as a local variable
+  # +account+ to the template for display.
   #
   # In another template for Advertiser#buy, we could have:
   #
@@ -18,24 +19,24 @@ module ActionView
   #     &lt;%= render :partial =&gt; &quot;ad&quot;, :locals =&gt; { :ad =&gt; ad } %&gt;
   #   &lt;% end %&gt;
   #
-  # This would first render &quot;advertiser/_account.erb&quot; with @buyer passed in as the local variable +account+, then render
-  # &quot;advertiser/_ad.erb&quot; and pass the local variable +ad+ to the template for display.
+  # This would first render &quot;advertiser/_account.erb&quot; with @buyer passed in as the local variable +account+, then
+  # render &quot;advertiser/_ad.erb&quot; and pass the local variable +ad+ to the template for display.
   #
   # == Rendering a collection of partials
   #
-  # The example of partial use describes a familiar pattern where a template needs to iterate over an array and render a sub
-  # template for each of the elements. This pattern has been implemented as a single method that accepts an array and renders
-  # a partial by the same name as the elements contained within. So the three-lined example in &quot;Using partials&quot; can be rewritten
-  # with a single line:
+  # The example of partial use describes a familiar pattern where a template needs to iterate over an array and
+  # render a sub template for each of the elements. This pattern has been implemented as a single method that
+  # accepts an array and renders a partial by the same name as the elements contained within. So the three-lined
+  # example in &quot;Using partials&quot; can be rewritten with a single line:
   #
   #   &lt;%= render :partial =&gt; &quot;ad&quot;, :collection =&gt; @advertisements %&gt;
   #
-  # This will render &quot;advertiser/_ad.erb&quot; and pass the local variable +ad+ to the template for display. An iteration counter
-  # will automatically be made available to the template with a name of the form +partial_name_counter+. In the case of the
-  # example above, the template would be fed +ad_counter+.
+  # This will render &quot;advertiser/_ad.erb&quot; and pass the local variable +ad+ to the template for display. An
+  # iteration counter will automatically be made available to the template with a name of the form
+  # +partial_name_counter+. In the case of the example above, the template would be fed +ad_counter+.
   #
-  # NOTE: Due to backwards compatibility concerns, the collection can't be one of hashes. Normally you'd also just keep domain objects,
-  # like Active Records, in there.
+  # NOTE: Due to backwards compatibility concerns, the collection can't be one of hashes. Normally you'd also
+  # just keep domain objects, like Active Records, in there.
   #
   # == Rendering shared partials
   #
@@ -47,8 +48,9 @@ module ActionView
   #
   # == Rendering partials with layouts
   #
-  # Partials can have their own layouts applied to them. These layouts are different than the ones that are specified globally
-  # for the entire action, but they work in a similar fashion. Imagine a list with two types of users:
+  # Partials can have their own layouts applied to them. These layouts are different than the ones that are
+  # specified globally for the entire action, but they work in a similar fashion. Imagine a list with two types
+  # of users:
   #
   #   &lt;%# app/views/users/index.html.erb &amp;&gt;
   #   Here's the administrator:
@@ -139,36 +141,51 @@ module ActionView
     extend ActiveSupport::Memoizable
 
     private
-      def render_partial(partial_path, object_assigns = nil, local_assigns = {}) #:nodoc:
-        local_assigns ||= {}
+      def render_partial(options = {}) #:nodoc:
+        local_assigns = options[:locals] || {}
 
-        case partial_path
+        case partial_path = options[:partial]
         when String, Symbol, NilClass
-          pick_template(find_partial_path(partial_path)).render_partial(self, object_assigns, local_assigns)
+          if options.has_key?(:collection)
+            render_partial_collection(options)
+          else
+            pick_template(find_partial_path(partial_path)).render_partial(self, options[:object], local_assigns)
+          end
         when ActionView::Helpers::FormBuilder
           builder_partial_path = partial_path.class.to_s.demodulize.underscore.sub(/_builder$/, '')
-          render_partial(builder_partial_path, object_assigns, (local_assigns || {}).merge(builder_partial_path.to_sym =&gt; partial_path))
+          render_partial(
+            :partial =&gt; builder_partial_path,
+            :object =&gt; options[:object],
+            :locals =&gt; local_assigns.merge(builder_partial_path.to_sym =&gt; partial_path)
+          )
         when Array, ActiveRecord::Associations::AssociationCollection, ActiveRecord::NamedScope::Scope
           if partial_path.any?
-            collection = partial_path
-            render_partial_collection(nil, collection, nil, local_assigns)
+            render_partial(:collection =&gt; partial_path, :locals =&gt; local_assigns)
           else
             &quot;&quot;
           end
         else
-          render_partial(ActionController::RecordIdentifier.partial_path(partial_path, controller.class.controller_path), partial_path, local_assigns)
+          object = partial_path
+          render_partial(
+            :partial =&gt; ActionController::RecordIdentifier.partial_path(object, controller.class.controller_path),
+            :object =&gt; object,
+            :locals =&gt; local_assigns
+          )
         end
       end
 
-      def render_partial_collection(partial_path, collection, partial_spacer_template = nil, local_assigns = {}, as = nil) #:nodoc:
-        return nil if collection.blank?
+      def render_partial_collection(options = {}) #:nodoc:
+        return nil if options[:collection].blank?
 
-        local_assigns = local_assigns ? local_assigns.clone : {}
-        spacer = partial_spacer_template ? render(:partial =&gt; partial_spacer_template) : ''
+        partial = options[:partial]
+        spacer = options[:spacer_template] ? render(:partial =&gt; options[:spacer_template]) : ''
+        local_assigns = options[:locals] ? options[:locals].clone : {}
+        as = options[:as]
 
         index = 0
-        collection.map do |object|
-          _partial_path ||= partial_path || ActionController::RecordIdentifier.partial_path(object, controller.class.controller_path)
+        options[:collection].map do |object|
+          _partial_path ||= partial ||
+            ActionController::RecordIdentifier.partial_path(object, controller.class.controller_path)
           path = find_partial_path(_partial_path)
           template = pick_template(path)
           local_assigns[template.counter_name] = index
@@ -178,7 +195,7 @@ module ActionView
         end.join(spacer)
       end
 
-      def find_partial_path(partial_path)
+      def find_partial_path(partial_path) #:nodoc:
         if partial_path.include?('/')
           File.join(File.dirname(partial_path), &quot;_#{File.basename(partial_path)}&quot;)
         elsif respond_to?(:controller)</diff>
      <filename>actionpack/lib/action_view/partials.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>e6a66cbd056f177f7e60341799aa95791fcfa19d</id>
    </parent>
  </parents>
  <author>
    <name>Ryan Bates</name>
    <email>ryan@railscasts.com</email>
  </author>
  <url>http://github.com/rails/rails/commit/1129a24caff9f1804c2bff6569c0cbd8598dfa86</url>
  <id>1129a24caff9f1804c2bff6569c0cbd8598dfa86</id>
  <committed-date>2008-08-21T19:03:33-07:00</committed-date>
  <authored-date>2008-08-21T19:02:10-07:00</authored-date>
  <message>Cleanup around partial rendering

Signed-off-by: Joshua Peek &lt;josh@joshpeek.com&gt;</message>
  <tree>14a20c4c8e6e5fd05cad221de2231aefa40b849d</tree>
  <committer>
    <name>Joshua Peek</name>
    <email>josh@joshpeek.com</email>
  </committer>
</commit>
