<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,21 @@
 *2.3.0/3.0*
 
+* Changed the default of ActionView#render to assume partials instead of files when not given an options hash [DHH]. Examples:
+
+    # Instead of &lt;%= render :partial =&gt; &quot;account&quot; %&gt;
+    &lt;%= render &quot;account&quot; %&gt;
+    
+    # Instead of &lt;%= render :partial =&gt; &quot;account&quot;, :locals =&gt; { :account =&gt; @buyer } %&gt;
+    &lt;%= render &quot;account&quot;, :account =&gt; @buyer %&gt;
+    
+    # @account is an Account instance, so it uses the RecordIdentifier to replace
+    # &lt;%= render :partial =&gt; &quot;accounts/account&quot;, :locals =&gt; { :account =&gt; @account } %&gt;
+    &lt;%= render(@account) %&gt;
+    
+    # @posts is an array of Post instances, so it uses the RecordIdentifier to replace
+    # &lt;%= render :partial =&gt; &quot;posts/post&quot;, :collection =&gt; @posts %&gt;
+    &lt;%= render(@posts) %&gt;
+
 * Fixed RedCloth and BlueCloth shouldn't preload. Instead just assume that they're available if you want to use textilize and markdown and let autoload require them [DHH]
 
 </diff>
      <filename>actionpack/CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -234,16 +234,21 @@ module ActionView #:nodoc:
       @view_paths = self.class.process_view_paths(paths)
     end
 
-    # Renders the template present at &lt;tt&gt;template_path&lt;/tt&gt; (relative to the view_paths array).
-    # The hash in &lt;tt&gt;local_assigns&lt;/tt&gt; is made available as local variables.
+    # Returns the result of a render that's dictated by the options hash. The primary options are:
+    # 
+    # * &lt;tt&gt;:partial&lt;/tt&gt; - See ActionView::Partials.
+    # * &lt;tt&gt;:update&lt;/tt&gt; - Calls update_page with the block given.
+    # * &lt;tt&gt;:file&lt;/tt&gt; - Renders an explicit template file (this used to be the old default), add :locals to pass in those.
+    # * &lt;tt&gt;:inline&lt;/tt&gt; - Renders an inline template similar to how it's done in the controller.
+    # * &lt;tt&gt;:text&lt;/tt&gt; - Renders the text passed in out.
+    #
+    # If no options hash is passed or :update specified, the default is to render a partial and use the second parameter
+    # as the locals hash.
     def render(options = {}, local_assigns = {}, &amp;block) #:nodoc:
       local_assigns ||= {}
 
-      if options.is_a?(String)
-        render(:file =&gt; options, :locals =&gt; local_assigns)
-      elsif options == :update
-        update_page(&amp;block)
-      elsif options.is_a?(Hash)
+      case options
+      when Hash
         options = options.reverse_merge(:locals =&gt; {})
         if options[:layout]
           _render_with_layout(options, local_assigns, &amp;block)
@@ -256,6 +261,10 @@ module ActionView #:nodoc:
         elsif options[:text]
           options[:text]
         end
+      when :update
+        update_page(&amp;block)
+      else
+        render_partial(:partial =&gt; options, :locals =&gt; local_assigns)
       end
     end
 </diff>
      <filename>actionpack/lib/action_view/base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -46,6 +46,38 @@ module ActionView
   #
   # This will render the partial &quot;advertisement/_ad.erb&quot; regardless of which controller this is being called from.
   #
+  # == Rendering objects with the RecordIdentifier
+  #
+  # Instead of explicitly naming the location of a partial, you can also let the RecordIdentifier do the work if
+  # you're following its conventions for RecordIdentifier#partial_path. Examples:
+  #
+  #  # @account is an Account instance, so it uses the RecordIdentifier to replace
+  #  # &lt;%= render :partial =&gt; &quot;accounts/account&quot;, :locals =&gt; { :account =&gt; @buyer } %&gt;
+  #  &lt;%= render :partial =&gt; @account %&gt;
+  #
+  #  # @posts is an array of Post instances, so it uses the RecordIdentifier to replace
+  #  # &lt;%= render :partial =&gt; &quot;posts/post&quot;, :collection =&gt; @posts %&gt;
+  #  &lt;%= render :partial =&gt; @posts %&gt;
+  #
+  # == Rendering the default case
+  #
+  # If you're not going to be using any of the options like collections or layouts, you can also use the short-hand
+  # defaults of render to render partials. Examples:
+  #
+  #  # Instead of &lt;%= render :partial =&gt; &quot;account&quot; %&gt;
+  #  &lt;%= render &quot;account&quot; %&gt;
+  #
+  #  # Instead of &lt;%= render :partial =&gt; &quot;account&quot;, :locals =&gt; { :account =&gt; @buyer } %&gt;
+  #  &lt;%= render &quot;account&quot;, :account =&gt; @buyer %&gt;
+  #
+  #  # @account is an Account instance, so it uses the RecordIdentifier to replace
+  #  # &lt;%= render :partial =&gt; &quot;accounts/account&quot;, :locals =&gt; { :account =&gt; @account } %&gt;
+  #  &lt;%= render(@account) %&gt;
+  #
+  #  # @posts is an array of Post instances, so it uses the RecordIdentifier to replace
+  #  # &lt;%= render :partial =&gt; &quot;posts/post&quot;, :collection =&gt; @posts %&gt;
+  #  &lt;%= render(@posts) %&gt;
+  #
   # == Rendering partials with layouts
   #
   # Partials can have their own layouts applied to them. These layouts are different than the ones that are</diff>
      <filename>actionpack/lib/action_view/partials.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,4 +1,4 @@
 xml.html do
   xml.p &quot;Hello #{@name}&quot;
-  xml &lt;&lt; render(&quot;test/greeting&quot;)
+  xml &lt;&lt; render(:file =&gt; &quot;test/greeting&quot;)
 end
\ No newline at end of file</diff>
      <filename>actionpack/test/fixtures/test/hello.builder</filename>
    </modified>
    <modified>
      <diff>@@ -12,30 +12,30 @@ uses_mocha 'TestTemplateRecompilation' do
 
     def test_template_gets_compiled
       assert_equal 0, @compiled_templates.instance_methods.size
-      assert_equal &quot;Hello world!&quot;, render(&quot;test/hello_world.erb&quot;)
+      assert_equal &quot;Hello world!&quot;, render(:file =&gt; &quot;test/hello_world.erb&quot;)
       assert_equal 1, @compiled_templates.instance_methods.size
     end
 
     def test_template_gets_recompiled_when_using_different_keys_in_local_assigns
       assert_equal 0, @compiled_templates.instance_methods.size
-      assert_equal &quot;Hello world!&quot;, render(&quot;test/hello_world.erb&quot;)
-      assert_equal &quot;Hello world!&quot;, render(&quot;test/hello_world.erb&quot;, {:foo =&gt; &quot;bar&quot;})
+      assert_equal &quot;Hello world!&quot;, render(:file =&gt; &quot;test/hello_world.erb&quot;)
+      assert_equal &quot;Hello world!&quot;, render(:file =&gt; &quot;test/hello_world.erb&quot;, :locals =&gt; {:foo =&gt; &quot;bar&quot;})
       assert_equal 2, @compiled_templates.instance_methods.size
     end
 
     def test_compiled_template_will_not_be_recompiled_when_rendered_with_identical_local_assigns
       assert_equal 0, @compiled_templates.instance_methods.size
-      assert_equal &quot;Hello world!&quot;, render(&quot;test/hello_world.erb&quot;)
+      assert_equal &quot;Hello world!&quot;, render(:file =&gt; &quot;test/hello_world.erb&quot;)
       ActionView::Template.any_instance.expects(:compile!).never
-      assert_equal &quot;Hello world!&quot;, render(&quot;test/hello_world.erb&quot;)
+      assert_equal &quot;Hello world!&quot;, render(:file =&gt; &quot;test/hello_world.erb&quot;)
     end
 
     def test_compiled_template_will_always_be_recompiled_when_eager_loaded_templates_is_off
       ActionView::PathSet::Path.expects(:eager_load_templates?).times(4).returns(false)
       assert_equal 0, @compiled_templates.instance_methods.size
-      assert_equal &quot;Hello world!&quot;, render(&quot;#{FIXTURE_LOAD_PATH}/test/hello_world.erb&quot;)
+      assert_equal &quot;Hello world!&quot;, render(:file =&gt; &quot;#{FIXTURE_LOAD_PATH}/test/hello_world.erb&quot;)
       ActionView::Template.any_instance.expects(:compile!).times(3)
-      3.times { assert_equal &quot;Hello world!&quot;, render(&quot;#{FIXTURE_LOAD_PATH}/test/hello_world.erb&quot;) }
+      3.times { assert_equal &quot;Hello world!&quot;, render(:file =&gt; &quot;#{FIXTURE_LOAD_PATH}/test/hello_world.erb&quot;) }
       assert_equal 1, @compiled_templates.instance_methods.size
     end
 </diff>
      <filename>actionpack/test/template/compiled_templates_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -8,7 +8,7 @@ class ViewRenderTest &lt; Test::Unit::TestCase
   end
 
   def test_render_file
-    assert_equal &quot;Hello world!&quot;, @view.render(&quot;test/hello_world.erb&quot;)
+    assert_equal &quot;Hello world!&quot;, @view.render(:file =&gt; &quot;test/hello_world.erb&quot;)
   end
 
   def test_render_file_not_using_full_path
@@ -16,11 +16,11 @@ class ViewRenderTest &lt; Test::Unit::TestCase
   end
 
   def test_render_file_without_specific_extension
-    assert_equal &quot;Hello world!&quot;, @view.render(&quot;test/hello_world&quot;)
+    assert_equal &quot;Hello world!&quot;, @view.render(:file =&gt; &quot;test/hello_world&quot;)
   end
 
   def test_render_file_at_top_level
-    assert_equal 'Elastica', @view.render('/shared')
+    assert_equal 'Elastica', @view.render(:file =&gt; '/shared')
   end
 
   def test_render_file_with_full_path
@@ -29,20 +29,20 @@ class ViewRenderTest &lt; Test::Unit::TestCase
   end
 
   def test_render_file_with_instance_variables
-    assert_equal &quot;The secret is in the sauce\n&quot;, @view.render(&quot;test/render_file_with_ivar.erb&quot;)
+    assert_equal &quot;The secret is in the sauce\n&quot;, @view.render(:file =&gt; &quot;test/render_file_with_ivar.erb&quot;)
   end
 
   def test_render_file_with_locals
     locals = { :secret =&gt; 'in the sauce' }
-    assert_equal &quot;The secret is in the sauce\n&quot;, @view.render(&quot;test/render_file_with_locals.erb&quot;, locals)
+    assert_equal &quot;The secret is in the sauce\n&quot;, @view.render(:file =&gt; &quot;test/render_file_with_locals.erb&quot;, :locals =&gt; locals)
   end
 
   def test_render_file_not_using_full_path_with_dot_in_path
-    assert_equal &quot;The secret is in the sauce\n&quot;, @view.render(&quot;test/dot.directory/render_file_with_ivar&quot;)
+    assert_equal &quot;The secret is in the sauce\n&quot;, @view.render(:file =&gt; &quot;test/dot.directory/render_file_with_ivar&quot;)
   end
 
   def test_render_has_access_current_template
-    assert_equal &quot;test/template.erb&quot;, @view.render(&quot;test/template.erb&quot;)
+    assert_equal &quot;test/template.erb&quot;, @view.render(:file =&gt; &quot;test/template.erb&quot;)
   end
 
   def test_render_update
@@ -51,6 +51,10 @@ class ViewRenderTest &lt; Test::Unit::TestCase
     assert_equal 'alert(&quot;Hello, World!&quot;);', @view.render(:update) { |page| page.alert('Hello, World!') }
   end
 
+  def test_render_partial_from_default
+    assert_equal &quot;only partial&quot;, @view.render(&quot;test/partial_only&quot;)
+  end
+
   def test_render_partial
     assert_equal &quot;only partial&quot;, @view.render(:partial =&gt; &quot;test/partial_only&quot;)
   end
@@ -73,6 +77,10 @@ class ViewRenderTest &lt; Test::Unit::TestCase
     assert_equal &quot;5&quot;, @view.render(:partial =&gt; &quot;test/counter&quot;, :locals =&gt; { :counter_counter =&gt; 5 })
   end
 
+  def test_render_partial_with_locals_from_default
+    assert_equal &quot;only partial&quot;, @view.render(&quot;test/partial_only&quot;, :counter_counter =&gt; 5)
+  end
+
   def test_render_partial_with_errors
     @view.render(:partial =&gt; &quot;test/raise&quot;)
     flunk &quot;Render did not raise TemplateError&quot;</diff>
      <filename>actionpack/test/template/render_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>0c9f677e7861ef2aae36d91811d72794e4709f58</id>
    </parent>
  </parents>
  <author>
    <name>David Heinemeier Hansson</name>
    <email>david@loudthinking.com</email>
  </author>
  <url>http://github.com/rails/rails/commit/130fe74d17404e5c06353526c7b20beb4019cb69</url>
  <id>130fe74d17404e5c06353526c7b20beb4019cb69</id>
  <committed-date>2008-11-19T05:00:16-08:00</committed-date>
  <authored-date>2008-11-19T05:00:16-08:00</authored-date>
  <message>Changed the default of ActionView#render to assume partials instead of files when not given an options hash [DHH]</message>
  <tree>ad15653d1f1ab20151d4bdc934106e8f857d08f7</tree>
  <committer>
    <name>David Heinemeier Hansson</name>
    <email>david@loudthinking.com</email>
  </committer>
</commit>
