In Rails 4 you can do something similar to:
Model.order(foo: :asc, bar: :desc)
foo
and bar
are columns in the db.
More Related Contents:
- Blog and Static Pages in Rails 4
- Auto-loading lib files in Rails 4
- How to find where a method is defined at runtime?
- bundle install fails with SSL certificate verification error
- Can’t find the PostgreSQL client library (libpq)
- How do I replace accented Latin characters in Ruby?
- How to chain scope queries with OR instead of AND?
- How do I explicitly specify a Model’s table-name mapping in Rails?
- Test if string is a number in Ruby on Rails
- Reducing n+1 queries using the Bullet and RSpec gems
- How do I make a column unique and index it in a Ruby on Rails migration?
- incompatible character encodings: ASCII-8BIT and UTF-8
- Alias for column names in Rails
- Rails 3 devise, current_user is not accessible in a Model ?
- Use YAML with variables
- Rails: How does the respond_to block work?
- Heroku deployment failed because of sqlite3 gem error
- Error installing Nokogiri 1.5.0 with rails 3.1.0 and ubuntu
- A migration to add unique constraint to a combination of columns
- POST JSON to API using Rails and HTTParty
- Devise update user without password
- Purge or recreate a Ruby on Rails database
- libffi.so.6: cannot open shared object file in rails
- 400 Bad Request – request header or cookie too large
- Rails + Postgres drop error: database is being accessed by other users
- Haml: Control whitespace around text
- Ruby on Rails 3 – Reload lib directory for each request
- How to change a Ruby on Rails application name?
- Rails: “Next post” and “Previous post” links in my show view, how to?
- How to configure Log4r with Rails 3.0.x?