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.
rails_admin sort_by scope
-
15-10-2022 - |
题
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
解决方案
不隶属于 StackOverflow