2014-04-10 04:01:34 +00:00
|
|
|
class UsersController < ApplicationController
|
2014-04-10 09:13:42 +00:00
|
|
|
layout "authentication"
|
2014-04-10 04:01:34 +00:00
|
|
|
def new
|
|
|
|
@user = User.new
|
|
|
|
end
|
|
|
|
|
|
|
|
def create
|
|
|
|
@user = User.new(user_params)
|
|
|
|
if @user.save
|
|
|
|
redirect_to root_url, :notice => "Signed Up Successfully!"
|
|
|
|
else
|
|
|
|
render "new"
|
|
|
|
end
|
|
|
|
end
|
|
|
|
|
|
|
|
private
|
|
|
|
|
|
|
|
# Never trust parameters from the scary internet, only allow the white list through.
|
|
|
|
def user_params
|
|
|
|
params.require(:user).permit(:email, :password, :password_confirmation, :user_name)
|
|
|
|
end
|
|
|
|
end
|