From b9b8b170c71f60526b43d4d231d7ea1c94a03a4f Mon Sep 17 00:00:00 2001 From: topickering Date: Fri, 11 Jan 2019 13:59:00 +0000 Subject: [PATCH] Edited profile and home page so that posts appear with most recent first --- app/controllers/profiles_controller.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/app/controllers/profiles_controller.rb b/app/controllers/profiles_controller.rb index dfaab05823..9f2128d999 100644 --- a/app/controllers/profiles_controller.rb +++ b/app/controllers/profiles_controller.rb @@ -8,7 +8,7 @@ def index @profile = User.find(current_user.id) @users = User.all @friends = Friend.where requester: @profile.username - @posts = Post.last(10) + @posts = Post.last(10).reverse @like = Like.new respond_with(@users) end @@ -16,7 +16,8 @@ def index def show @profile = User.find(params[:id]) @post = Post.new - @posts = Post.where recipient_username: @profile.username + profile_posts = Post.where recipient_username: @profile.username + @posts = profile_posts.reverse @bio = Bio.new @bio_profile = Bio.find_by(bio_username: @profile.username) @friend = Friend.new