class UsersController < ApplicationController

  def new
    @user = User.new
    render 'new'
  end

  def create
    @user = User.new(user_params)

    if @user.save
      session[:user_id] = @user.id
      redirect_to '/'
    else
      p '8' * 88
      p @user.errors.full_messages
      render 'new'
    end
  end

  def show
  	@user = User.find(params[:id])
  end

  def update
  end

  private

  def user_params
    params.require(:user).permit(:first_name, :last_name, :email, :password, :password_confirmation, :phone)
  end

end

class UsersController < ApplicationController

  def new
    @user = User.new
    render 'new'
  end

  def create
    @user = User.new(user_params)

    if @user.save
      redirect_to '/'
    else
      render 'new'
    end
  end

  def show
    @user = User.find(params[:id])
  end

  def update
    @user = User.find(params[:id])
    # if @user.update()
  end

  def edit
    @user = User.find(params[:id])
    render "edit"
  end

  private

  def user_params
    params.require(:user).permit(:first_name, :last_name, :email, :password, :phone)
  end

  def topic_params
    p"*"*90
    p params.require(:user).permit(:topic1, :topic2, :topic3)
  end
end

Copy changes from another branch
Copy changes from another branch
