summaryrefslogtreecommitdiff
path: root/app/controllers/users_controller.rb
blob: c14f67c3bcdc3516f1a52a6e45991d3dcad583da (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
27
28
29
30
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(params[:id])
	end

	def index
		@users = User.all
	end 

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