Question

I am using rails_admin and I have a list of objects
How would I sort by created_at >= 1.day.ago,

ie first show all users where created_at >= 1.day.ago then the rest

list do
  sort_by :created_at # created_at >= 1.day.ago
  field :id
  field :name
  field :address
  field :created_at
end
Was it helpful?

Solution

It looks like what you're trying to do is actually a filter - sort_by only lets you order the results by a database column - whereas you want to filter out any objects that are older than a certain date.

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top