title: Handle the answer of an AJAX POST call to a Rails controller on the front end javascript
body: <p>First, I do an AJAX POST call to my rails controller on the front end:</p>
  
  <pre><code>var request=$.ajax({
      url: url_up,
      type: "POST",
      beforeSend: function(xhr) {xhr.setRequestHeader('X-CSRF-Token', $('meta[name="csrf-token"]').attr('content'))},
      data: {q_param: {
               title: title, 
               total: total,
               list: list,
               client: idclient,
               tax_rate: tax_rate 
             }},
      success: function(data, textStatus, jqXHR) {
                quote_id=data;
                return false;
              },
      dataType: "json"
      });
  </code></pre>
  
  <p>This call works well and I can see it on the controller side. The controller renders a json answer: </p>
  
  <pre><code>def create
        @client=Client.find_by_id(params['q_param']['client'])
        @quote = @client.quotes.create(quote_p)
        render json:  {:quote_id=&gt;@quote.id}
  end
  </code></pre>
  
  <p>When doing this, I expect the quote_id variable to have the @quote.id. But it doesn't...
  Please could you tell me what's wrong? 
  Thanks </p>