In Rails 4 you can do something similar to:
Model.order(foo: :asc, bar: :desc)
foo
and bar
are columns in the db.
Related Contents:
- SSL_connect returned=1 errno=0 state=SSLv3 read server certificate B: certificate verify failed
- config.assets.compile=true in Rails production, why not?
- How do I get the current absolute URL in Ruby on Rails?
- Getting error: Peer authentication failed for user “postgres”, when trying to get pgsql working with rails
- What is the difference between
- Why isn’t my CORS configuration causing the server to filter incoming requests? How can I make the server only accept requests from a specific origin?
- What is the best method of handling currency/money?
- Learning Ruby on Rails
- How to get a random number in Ruby
- Rails – Strong Parameters – Nested Objects
- How to override to_json in Rails?
- no such file to load — rubygems (LoadError)
- How to do a LIKE query in Arel and Rails?
- Passing parameters in rails redirect_to
- PG::Error: SELECT DISTINCT, ORDER BY expressions must appear in select list
- Rails order by results count of has_many association
- Convert a Ruby on Rails app from sqlite to MySQL?
- Rails: select unique values from a column
- What is Rack middleware?
- How do you handle Rail’s flash with Ajax requests?
- invalid multibyte char (US-ASCII) with Rails and Ruby 1.9
- Ruby Bundle Symbol not found: _SSLv2_client_method (LoadError)
- How are Rails instance variables passed to views?
- Heroku Postgres Error: PGError: ERROR: relation “organizations” does not exist (ActiveRecord::StatementInvalid)
- How to set default values in Rails?
- How to skip ActiveRecord callbacks? [duplicate]
- Rails 4: organize rails models in sub path without namespacing models?
- What is the replacement for ActionController::Base.relative_url_root?
- Named routes _path vs _url
- What is the best way to seed a database in Rails?
- How to sign in a user using Devise from a Rails console?
- How can I find out the current route in Rails?
- A migration to add unique constraint to a combination of columns
- How to check for a JSON response using RSpec?
- Why are all Rails helpers available to all views, all the time? Is there a way to disable this?
- Overriding rails’ default rake tasks
- Undefined method raise_in_transactional_callbacks=’ for ActiveRecord::Base:Class (NoMethodError)
- Ruby-on-Rails: Multiple has_many :through possible?
- Rails naming convention for join table
- Setting Environment Variables in Rails 3 (Devise + Omniauth)
- how to read a User uploaded file, without saving it to the database
- How to display the time in user’s timezone
- Capybara with subdomains – default_host
- no such file to load — readline
- Rails 3.1 and Image Assets
- Converting an array of objects to ActiveRecord::Relation
- How to do static content in Rails?
- LoadError: Could not load the ‘listen’ gem (Rails 5)
- Rails App Not Serving Assets in Production Environment
- skip certain validation method in Model