I'm making a Rails app that uses Leaflet. I have some pipes on my map and I want this functionality: when I click on the map, I get, as a response, how many pipes are within the distance of 50 miles. Now, in order to get this information, I need ST_Distance method from postgis, used on Pipe class (in the pipes_controller). Leaflet can get me the coordinates of the click, I need to send these to the controller, get it to calculate the number of pipes within 50 miles and return that number so it can be shown through javascript. I don't know how to get ajax to do this in one request, as a post/get method.I'm making a Rails app that uses Leaflet. I hav