RubyFlow The Ruby and Rails community linklog

How to select database records in an arbitrary order

In Rails, it’s easy to get a bunch of records from your database if you have their IDs. But what if you wanted to get the records back in a specific order? Maybe your search engine returns the most relevant IDs first. How do you keep your records in that order?

Post a comment

You can use basic HTML markup (e.g. <a>) or Markdown.

As you are not logged in, you will be
directed via GitHub to signup or sign in