<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1,5 +1,12 @@
 *2.3.0 [Edge]*
 
+* Make ActionController#render(string) work as a shortcut for render :file =&gt; string. [#1435] [Pratik Naik] Examples:
+
+  # Instead of render(:file =&gt; '/Users/lifo/home.html.erb')
+  render('/Users/lifo/home.html.erb')
+
+  Note : Filename must begin with a forward slash ('/')
+
 * Add :prompt option to date/time select helpers. #561 [Sam Oliver]
 
 * Fixed that send_file shouldn't set an etag #1578 [Hongli Lai]</diff>
      <filename>actionpack/CHANGELOG</filename>
    </modified>
    <modified>
      <diff>@@ -865,6 +865,13 @@ module ActionController #:nodoc:
           return render(:file =&gt; default_template, :layout =&gt; true)
         elsif options == :update
           options = extra_options.merge({ :update =&gt; true })
+        elsif options.is_a?(String)
+          case options.index('/')
+          when 0
+            extra_options[:file] = options
+          end
+
+          options = extra_options
         end
 
         layout = pick_layout(options)
@@ -1183,7 +1190,7 @@ module ActionController #:nodoc:
       end
 
       def validate_render_arguments(options, extra_options)
-        if options &amp;&amp; options != :update &amp;&amp; !options.is_a?(Hash)
+        if options &amp;&amp; options != :update &amp;&amp; !options.is_a?(String) &amp;&amp; !options.is_a?(Hash)
           raise RenderError, &quot;You called render with invalid options : #{options.inspect}&quot;
         end
 </diff>
      <filename>actionpack/lib/action_controller/base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -104,6 +104,12 @@ class TestController &lt; ActionController::Base
     render :file =&gt; path
   end
 
+  def render_file_as_string_with_instance_variables
+    @secret = 'in the sauce'
+    path = File.expand_path(File.join(File.dirname(__FILE__), '../fixtures/test/render_file_with_ivar.erb'))
+    render path
+  end
+
   def render_file_not_using_full_path
     @secret = 'in the sauce'
     render :file =&gt; 'test/render_file_with_ivar'
@@ -124,6 +130,11 @@ class TestController &lt; ActionController::Base
     render :file =&gt; path, :locals =&gt; {:secret =&gt; 'in the sauce'}
   end
 
+  def render_file_as_string_with_locals
+    path = File.expand_path(File.join(File.dirname(__FILE__), '../fixtures/test/render_file_with_locals.erb'))
+    render path, :locals =&gt; {:secret =&gt; 'in the sauce'}
+  end
+
   def accessing_request_in_template
     render :inline =&gt;  &quot;Hello: &lt;%= request.host %&gt;&quot;
   end
@@ -182,10 +193,6 @@ class TestController &lt; ActionController::Base
     render :text =&gt; &quot;appended&quot;
   end
 
-  def render_invalid_args
-    render(&quot;test/hello&quot;)
-  end
-
   def render_vanilla_js_hello
     render :js =&gt; &quot;alert('hello')&quot;
   end
@@ -751,6 +758,11 @@ class RenderTest &lt; ActionController::TestCase
     assert_equal &quot;The secret is in the sauce\n&quot;, @response.body
   end
 
+  def test_render_file_as_string_with_instance_variables
+    get :render_file_as_string_with_instance_variables
+    assert_equal &quot;The secret is in the sauce\n&quot;, @response.body
+  end
+
   def test_render_file_not_using_full_path
     get :render_file_not_using_full_path
     assert_equal &quot;The secret is in the sauce\n&quot;, @response.body
@@ -766,6 +778,11 @@ class RenderTest &lt; ActionController::TestCase
     assert_equal &quot;The secret is in the sauce\n&quot;, @response.body
   end
 
+  def test_render_file_as_string_with_locals
+    get :render_file_as_string_with_locals
+    assert_equal &quot;The secret is in the sauce\n&quot;, @response.body
+  end
+
   def test_render_file_from_template
     get :render_file_from_template
     assert_equal &quot;The secret is in the sauce\n&quot;, @response.body
@@ -831,10 +848,6 @@ class RenderTest &lt; ActionController::TestCase
     assert_equal 'appended', @response.body
   end
 
-  def test_attempt_to_render_with_invalid_arguments
-    assert_raises(ActionController::RenderError) { get :render_invalid_args }
-  end
-
   def test_attempt_to_access_object_method
     assert_raises(ActionController::UnknownAction, &quot;No action responded to [clone]&quot;) { get :clone }
   end</diff>
      <filename>actionpack/test/controller/render_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>dd0753458f2a16c876c52734f84a242f56746607</id>
    </parent>
  </parents>
  <author>
    <name>Pratik Naik</name>
    <email>pratiknaik@gmail.com</email>
  </author>
  <url>http://github.com/rails/rails/commit/061952392afd1dae1aa97a816e9a0c79df7c4514</url>
  <id>061952392afd1dae1aa97a816e9a0c79df7c4514</id>
  <committed-date>2008-12-25T13:43:07-08:00</committed-date>
  <authored-date>2008-12-25T13:27:56-08:00</authored-date>
  <message>Make ActionController#render(string) work as a shortcut for render :file =&gt; string. [#1435]

Examples:
  # Instead of render(:file =&gt; '/Users/lifo/home.html.erb')
  render('/Users/lifo/home.html.erb')

Note : Filename must begin with a forward slash ('/')</message>
  <tree>ce5599e69468632d5898ddb5088f0d729e4ddc91</tree>
  <committer>
    <name>Pratik Naik</name>
    <email>pratiknaik@gmail.com</email>
  </committer>
</commit>
