RubyFlow The Ruby and Rails community linklog

×

The Ruby and Rails community linklog

Made a library? Written a blog post? Found a useful tutorial? Share it with the Ruby community here or just enjoy what everyone else has found!

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