按照时间从晚到早的顺序排序
在mysql 的表里面建立一个这个列:
create_at
rails 就会自动的为数据建立时间标签.
查询:
@order = User.find (:all,
:conditions => “name = ‘Dave’ ”
rder => “create_at DESC”
)
评论关闭
rubysearch site archives
在mysql 的表里面建立一个这个列:
create_at
rails 就会自动的为数据建立时间标签.
查询:
@order = User.find (:all,
:conditions => “name = ‘Dave’ ”
rder => “create_at DESC”
)