<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -1068,7 +1068,7 @@ module ActionView
     
       def build_observer(klass, name, options = {})
         if options[:with] &amp;&amp; (options[:with] !~ /[\{=(.]/)
-          options[:with] = &quot;'#{options[:with]}=' + value&quot;
+          options[:with] = &quot;'#{options[:with]}=' + encodeURIComponent(value)&quot;
         else
           options[:with] ||= 'value' unless options[:function]
         end</diff>
      <filename>actionpack/lib/action_view/helpers/prototype_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -219,9 +219,9 @@ class PrototypeHelperTest &lt; PrototypeHelperBaseTest
   end
   
   def test_observe_field_using_with_option
-    expected = %(&lt;script type=\&quot;text/javascript\&quot;&gt;\n//&lt;![CDATA[\nnew Form.Element.Observer('glass', 300, function(element, value) {new Ajax.Request('http://www.example.com/check_value', {asynchronous:true, evalScripts:true, parameters:'id=' + value})})\n//]]&gt;\n&lt;/script&gt;)
+    expected = %(&lt;script type=\&quot;text/javascript\&quot;&gt;\n//&lt;![CDATA[\nnew Form.Element.Observer('glass', 300, function(element, value) {new Ajax.Request('http://www.example.com/check_value', {asynchronous:true, evalScripts:true, parameters:'id=' + encodeURIComponent(value)})})\n//]]&gt;\n&lt;/script&gt;)
     assert_dom_equal expected, observe_field(&quot;glass&quot;, :frequency =&gt; 5.minutes, :url =&gt; { :action =&gt; &quot;check_value&quot; }, :with =&gt; 'id')
-    assert_dom_equal expected, observe_field(&quot;glass&quot;, :frequency =&gt; 5.minutes, :url =&gt; { :action =&gt; &quot;check_value&quot; }, :with =&gt; &quot;'id=' + value&quot;)
+    assert_dom_equal expected, observe_field(&quot;glass&quot;, :frequency =&gt; 5.minutes, :url =&gt; { :action =&gt; &quot;check_value&quot; }, :with =&gt; &quot;'id=' + encodeURIComponent(value)&quot;)
   end
   
   def test_observe_field_using_json_in_with_option</diff>
      <filename>actionpack/test/template/prototype_helper_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>c1c1d6c2ea72424dfae0b5ee1991d904dcf0f252</id>
    </parent>
  </parents>
  <author>
    <name>Frederick Cheung</name>
    <email>frederick.cheung@gmail.com</email>
  </author>
  <url>http://github.com/rails/rails/commit/17d1319c480e58e28641b243da50ae5e5eab89dc</url>
  <id>17d1319c480e58e28641b243da50ae5e5eab89dc</id>
  <committed-date>2008-05-19T02:30:56-07:00</committed-date>
  <authored-date>2008-05-17T11:12:36-07:00</authored-date>
  <message>Ensure observe_field encodes value parameter. [#216 state:resolved]

Signed-off-by: Pratik Naik &lt;pratiknaik@gmail.com&gt;</message>
  <tree>511ad2ba892080ec6bd05b9e3659dd326bb18906</tree>
  <committer>
    <name>Pratik Naik</name>
    <email>pratiknaik@gmail.com</email>
  </committer>
</commit>
