title: Hacking RJS behaviour in Rails 5
body: <p>I have a old rails 2.x project that I have converted mostly over to rails 5.</p>
  
  <p>One issue is some of my actions used RJS, so it looked like:</p>
  
  <pre><code>if request.xhr?
    render :action =&gt; 'new_user' and return
  end
  </code></pre>
  
  <p>The new_user.js.rjs looks something like:</p>
  
  <pre><code>page.call "User.create", render(:partial =&gt; 'new_user'), {:userId =&gt; @user.id}
  </code></pre>
  
  <p>Looking at the response in chrome I can see it is just returning:</p>
  
  <pre><code>User.create('&lt;tr&gt;&lt;td&gt;....&lt;/td&gt;&lt;/tr&gt;', {"userId" : 123});
  </code></pre>
  
  <p>I only have to support the page.call type RJS call, what would be a easy "hack" to get this to work in rails 5?</p>
  
  <p>I don't want to modify all of my javascript code, I just need to basically have a javascript block that I pass the JS code to in my view pages right?</p>