I’m using the rails gem kaminari (https://github.com/amatsuda/kaminari) in order to paginate my posts database. Currently I have the code @posts = Post.order('id').page(params[:page]).per(5) in my controller, but this orders the pages from earliest to most recent. How do I reverse this and order from most recent to earliest?
I’m using the rails gem kaminari (https://github.com/amatsuda/kaminari) in order to paginate my posts database.
Share
in your model you can do:
or