I’m currently using:
@users = User.order(“RANDOM()”).limit(6)
to generate a list of 6 random users – however, this method takes a 1200ms toll on page load times. Is there a faster/more efficient way to call 6 random users?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
I ended up using the method described here:
Rails select random record
@ramc – Thank you for your comment. Load times are now much faster 🙂