Jump to content

The ultimate community for Ruby on Rails developers.


Search results with random geo city

  • Please log in to reply
No replies to this topic

#1 keither78



  • Members
  • 2 posts

Posted 02 April 2014 - 06:49 PM

Hello all.  I have an application with a search that gets users.  When the user does a search it looks at the users location and and just gets random users from the database.  It then pulls locations within X miles of the users location from the database and stores them in @locations.  When the results are displayed the users location is just a random from @locations (@locations.sample.city).


My question: What would be the best way to cache the results.  For example if the search returned User2's location at Nantucket then when the search is performed again User2 will still have Nantucket as it's location instead of another random location.


Thanks in advance.

0 user(s) are reading this topic

0 members, 0 guests, 0 anonymous users