title: Rails AJAX (JSON) response reloads the page
body: <p>In the controller a response to an AJAX Request is following:</p>
  
  <pre><code>@response = {resp: "ack"}
  render json: @response
  </code></pre>
  
  <p>JS which handles AJAX is:</p>
  
  <pre><code>$('#some_btn').click(function() {    
  
      var valuesToSubmit = $('#some_form').serialize();
      var url = $('#some_form').attr('action');
  
      console.log("VALUE: " + valuesToSubmit);
      console.log("URL: " + search_url);
  
      $.ajax({
          type: 'POST',
          url: url, //sumbits it to the given url of the form
          data: valuesToSubmit,
          dataType: "JSON",
          success: function(data) {
  
              console.log("saved");
              console.log(data);
  
          }
      });
  
      return false;
  });
  </code></pre>
  
  <p>But the problem is that I don't get console messages, instead the page reloads and I get json as text on a new page. How to prevent this "non-true-AJAX" behaviour?</p>