Using PostgreSQL on my Rails application but rails method Order is not working.
@[email protected]("created_at DESC")
It gives me the same results as
@[email protected]("created_at ASC")
Using MySQL it's working but in PostgreSQL not working, I am using Rails 3.2.11 and ruby 1.9.3.
Try this
@comments = @album.comments.order(:created_at) for ascending order
@comments = @album.comments.order(:created_at).reverse_order for descending order
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With