Reputation: 1836
I am using on console:
User.all(:order => "created_at ASC")
by replacing Client with my Model User from Rubyonrails.org, but its giving me this error:
ArgumentError: wrong number of arguments (1 for 0)
What's wrong with it?
Upvotes: 1
Views: 84
Reputation: 13477
You should use ActiveRecord#order
for this goal:
User.order("created_at ASC")
or just:
User.order(:created_at)
in your case.
ActiveRecord#all
method not expects any arguments.
Upvotes: 6