Do you need to create instance variable @user_posts? Shouldn't current_user.posts be available to you to use in views?