<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -801,6 +801,19 @@ module ActionController #:nodoc:
       #   # Renders &quot;Hello from code!&quot;
       #   render :text =&gt; proc { |response, output| output.write(&quot;Hello from code!&quot;) }
       #
+      # === Rendering XML
+      #
+      # Rendering XML sets the content type to application/xml.
+      #
+      #   # Renders '&lt;name&gt;David&lt;/name&gt;'
+      #   render :xml =&gt; {:name =&gt; &quot;David&quot;}.to_xml
+      #
+      # It's not necessary to call &lt;tt&gt;to_xml&lt;/tt&gt; on the object you want to render, since &lt;tt&gt;render&lt;/tt&gt; will
+      # automatically do that for you:
+      #
+      #   # Also renders '&lt;name&gt;David&lt;/name&gt;'
+      #   render :xml =&gt; {:name =&gt; &quot;David&quot;}
+      #
       # === Rendering JSON
       #
       # Rendering JSON sets the content type to application/json and optionally wraps the JSON in a callback. It is expected
@@ -846,7 +859,12 @@ module ActionController #:nodoc:
       #     page.visual_effect :highlight, 'user_list'
       #   end
       #
-      # === Rendering with status and location headers
+      # === Rendering vanilla JavaScript
+      #
+      # In addition to using RJS with render :update, you can also just render vanilla JavaScript with :js.
+      #
+      #   # Renders &quot;alert('hello')&quot; and sets the mime type to text/javascript
+      #   render :js =&gt; &quot;alert('hello')&quot;
       #
       # All renders take the &lt;tt&gt;:status&lt;/tt&gt; and &lt;tt&gt;:location&lt;/tt&gt; options and turn them into headers. They can even be used together:
       #
@@ -898,6 +916,10 @@ module ActionController #:nodoc:
             response.content_type ||= Mime::XML
             render_for_text(xml.respond_to?(:to_xml) ? xml.to_xml : xml, options[:status])
 
+          elsif js = options[:js]
+            response.content_type ||= Mime::JS
+            render_for_text(js, options[:status])
+
           elsif json = options[:json]
             json = json.to_json unless json.is_a?(String)
             json = &quot;#{options[:callback]}(#{json})&quot; unless options[:callback].blank?</diff>
      <filename>actionpack/lib/action_controller/base.rb</filename>
    </modified>
    <modified>
      <diff>@@ -184,6 +184,10 @@ class TestController &lt; ActionController::Base
     render(&quot;test/hello&quot;)
   end
 
+  def render_vanilla_js_hello
+    render :js =&gt; &quot;alert('hello')&quot;
+  end
+
   def render_xml_hello
     @name = &quot;David&quot;
     render :template =&gt; &quot;test/hello&quot;
@@ -844,6 +848,12 @@ class RenderTest &lt; Test::Unit::TestCase
     assert_equal &quot;test&quot;, @response.body # name is explicitly set to 'test' inside the controller.
   end
 
+  def test_render_vanilla_js
+    get :render_vanilla_js_hello
+    assert_equal &quot;alert('hello')&quot;, @response.body
+    assert_equal &quot;text/javascript&quot;, @response.content_type
+  end
+
   def test_render_xml
     get :render_xml_hello
     assert_equal &quot;&lt;html&gt;\n  &lt;p&gt;Hello David&lt;/p&gt;\n&lt;p&gt;This is grand!&lt;/p&gt;\n&lt;/html&gt;\n&quot;, @response.body</diff>
      <filename>actionpack/test/controller/render_test.rb</filename>
    </modified>
    <modified>
      <diff>@@ -1,5 +1,7 @@
 *2.2.1 [RC2 or 2.2 final]*
 
+* Added render :js for people who want to render inline JavaScript replies without using RJS [DHH]
+
 * Fixed the option merging in Array#to_xml #1126 [Rudolf Gavlas]
 
 * Make I18n::Backend::Simple reload its translations in development mode [DHH/Sven Fuchs]</diff>
      <filename>activesupport/CHANGELOG</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>408c7227575e0c395a45605783cade1ba3b51e02</id>
    </parent>
  </parents>
  <author>
    <name>David Heinemeier Hansson</name>
    <login>dhh</login>
    <email>david@loudthinking.com</email>
  </author>
  <url>http://github.com/rails/rails/commit/cbeac93310a7e95453bea3f2d4551288fd455d07</url>
  <id>cbeac93310a7e95453bea3f2d4551288fd455d07</id>
  <committed-date>2008-11-01T04:03:49-07:00</committed-date>
  <authored-date>2008-11-01T04:03:49-07:00</authored-date>
  <message>Added render :js for people who want to render inline JavaScript replies without using RJS [DHH]</message>
  <tree>fed49136581bf2f15b0616139b1e8ff0baed7434</tree>
  <committer>
    <name>David Heinemeier Hansson</name>
    <login>dhh</login>
    <email>david@loudthinking.com</email>
  </committer>
</commit>
