title: Convert rjs to js.erb in rails 3.1
body: <p>How to do I convert an rjs file to js.erb</p>
  
  <p>Just renaming doesn't work in my case </p>
  
  <p>This is my old code(works well with rails 2 app)</p>
  
  <pre><code>page.replace_html(
   "overlay" , 
    :partial =&gt; @path_resolver.resolve_template(
                  :tmpl_name =&gt; 'cmn/popup/shared/show_popup',
                  :partial =&gt; true
              ),
  :object =&gt; @content_data
  </code></pre>
  
  <p>)</p>
  
  <p>I changed the code to </p>
  
  <pre><code>  page.replace_html(
  "overlay" , 
  ("&lt;%= escape_javascript(render(
  :partial =&gt; @path_resolver.resolve_template(
                  :tmpl_name =&gt; 'cmn/popup/shared/show_popup',
                  :partial =&gt; true
              ))) %&gt;"),
  
   :locals =&gt; {:object =&gt; @content_data }
  </code></pre>
  
  <p>)</p>
  
  <p>Now I got an syntax error in firebug like </p>
  
  <pre><code> SyntaxError: syntax error
  
   :locals =&gt; {:object =&gt; @content_data }
  </code></pre>
  
  <p>If i pass the object code as <strong>:object => @content_data</strong> (without using locals)</p>
  
  <p>im getting another error </p>
  
  <pre><code> syntax error
   :object =&gt; @content_data 
  </code></pre>