title: Send data in params to rails back end using jQuery ajax get
body: <p>This has confused me on several different occasions and each time I struggle to find a good answer on the Internet or the World Wide Web.  Let's say that in my javascript file I have a variable</p>
  
  <pre><code>var myLoc = { lat: 35, lon: -110 }
  </code></pre>
  
  <p>that I got from using geolocation whatnot.  I want to send this information to the backend in order to associate it with a specific post I'm going to create.  </p>
  
  <p>Assume my routes are just this:</p>
  
  <pre><code>resources :users do
    resources :posts
  end
  </code></pre>
  
  <p>I don't know if this is the correct way, but what comes to mind is something like this:</p>
  
  <pre><code>$.get('/users/' + JSON.stringify(myLoc) + '/posts/new', function() {console.log("please work")});
  </code></pre>
  
  <p>My questions are:</p>
  
  <p>A. Should this work?<br>
  B. Is it the right way to do this?<br>
  C. Can you send front-end stuff like this to any route in the backend?</p>
  
  <p>Much appreciated.</p>