title: How could I send JSON object and get in return js code in rails 3.1?
body: <p>I have a list of html input items in my html page each representing different model. On click of the submit button, I would like to send all the details as a json object to the controller. From the controller, I would like to return the js code to the browser. </p>
  
  <p>As far as the examples I have seen, they are either sending the data as json and receive json from the server else send the data using form_for and receive the js code from the server. But I would like to send json and receive back js code. How i can do this in rails 3.1 using jQuery?</p>