class UsersController < ApplicationController

    before_action :set_user, :only => [:show]
    before_action :authenticate_user!
    before_action :user_owner, :only => [:show]
    # User a special layout for the user feed.
    layout "user-feed", :only => [:show, :dashboard]

    # GET - Show a user.
    def dashboard
        @user = User.find(params[:user_id])
    end

    def show

    end

end

class UsersController < ApplicationController

    before_action :set_user, :only => [:show]
    before_action :authenticate_user!
    before_action :user_owner, :only => [:show]
    # User a special layout for the user feed.
    layout "user-feed", :only => [:show, :dashboard]

    # GET - Show a user.
    def dashboard
        @user = User.find(params[:user_id])
        @posts = Post.where(:user_id => @user.id).order(created_at: :desc)
    end

    def show

    end

end

Create a post instance for the user dashboard page
Create a post instance for the user dashboard page

