app/controllers/users_controller.rb
#Check if already logged in so they dont create a user while logged in. Create a new user and check if 
#valid and saves. Set session id (log user in) and go to users/home. Redirects back to new if not.
Check if already logged in so they dont create a user while logged in. Create a new user and check if
valid and saves. Set session id (log user in) and go to users/home. Redirects back to new if not.
Check if already logged in so they dont create a user while logged in . Create a new user and check if valid and saves . Set session id ( log user in ) and go to users / home . Redirects back to new if not .
def create
        @user = User.new(user_params)
        if @user.valid? && @user.save
            session[:user_id] = @user.id
            redirect_to home_path(@user)
        else
            render :new
        end  
    end
def create @user = User . new ( user_params ) if @user . valid? && @user . save session [ :user_id ] = @user . id redirect_to home_path ( @user ) else render :new end end
Check if already logged in so they dont create a user while logged in.
Check if already logged in so they dont create a user while logged in .