Question

I was planning on building a web service in rails that would receive a users location from a request, through use of an API in a mobile app. It would then query a database based on that persons location as well as another parameter, the bid a business placed, compute a few algorithms and then sort and order those businesses based on the algorithm and send that order to display in the mobile app.

In starting the build, I thought perhaps there may be a ruby gem that does this service already, ie. Query the database by a location input, sort and rank certain entries by an algorithm I designed, and return the sorted businesses.

I have been looking but have yet to find such a gem to use and perhaps customize.

Does anything in the ballpark come to mind?

Was it helpful?

Solution

You are asking a lot that has to be cut into small pieces.

Querying a SQL database is best done by ActiveRecord, included with Rails. Using location with that is easily achieved with a gem such as Geocoder. Sorting and ranking by your own algorithm should by done by yourself: it is you own algorithm. However, you could use the supplied .order / .sort methods of ActiveRecord.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top