Showing the most recent database entry first

How would I go about showing the most recent database entry first then
to the next most recent… currently it is shown in chronological
order

On 10 May 2011 00:43, Brett T. [email protected] wrote:

How would I go about showing the most recent database entry first then
to the next most recent… currently it is shown in chronological
order

When you do the find that gets the records (in the controller index
action normally) just add an order clause to the search. See the
Rails Guide, Active Record Query Interface, on how to do it. If you
want always to sort this model in that order then do it in a
default_scope method in the model.

Colin

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs