app/controllers/users_controller.rb
# only logged in user can edit and update
only logged in user can edit and update
only logged in user can edit and update
def show
    @user = User.find(params[:id])
    @microposts = @user.microposts.paginate(page: params[:page])
    @micropost  = current_user.microposts.build
    @feed_items = current_user.feed.paginate(page: params[:page])
  end
def show @user = User . find ( params [ :id ] ) @microposts = @user . microposts . paginate ( page : params [ :page ] ) @micropost = current_user . microposts . build @feed_items = current_user . feed . paginate ( page : params [ :page ] ) end
only logged in user can edit and update
only logged in user can edit and update