summaryrefslogtreecommitdiff
path: root/app/controllers/users_controller.rb
blob: 6436e4e90c9738771e80326941e4e34e9c01d85d (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
class UsersController < ApplicationController

	def new
		@user = User.new
	end

  def create
    @user = User.new(user_params)
    if @user.save
      sign_in @user
      redirect_to root_path
    else
      render 'new'
    end
  end

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

	private
				
			def user_params
				params.require(:user).permit(:name, :email, :user_name, :password, :password_confirmation)
			end
end