title: How to pass variables from Jquery to the view in Rails 4
body: <p>After struggling many hours finding a solution to pass some variables from the view to the jquery code, now I have to do it vice-versa.</p>
  
  <p>Is there any solution to this?</p>
  
  <p>My scenario:</p>
  
  <ul>
  <li>2 values entered in a form.</li>
  <li>Values are sent to my API using Jquery in my view in rails.</li>
  <li>Data is back from my API</li>
  <li>I want to publish this data in the front-end.</li>
  </ul>
  
  <p>Any idea? Thxs in advance.</p>