mirror of
https://github.com/danbee/danbarberphoto
synced 2025-03-04 08:49:07 +00:00
26 lines
394 B
Ruby
26 lines
394 B
Ruby
class UsersController < ApplicationController
|
|
skip_before_action :require_login, only: [:new, :create]
|
|
|
|
def new
|
|
@user = User.new
|
|
end
|
|
|
|
def create
|
|
@user = sign_up(user_params)
|
|
|
|
if @user.valid?
|
|
sign_in(@user)
|
|
redirect_to root_path
|
|
else
|
|
render :new
|
|
end
|
|
end
|
|
|
|
private
|
|
|
|
def user_params
|
|
params.require(:user).permit(:email, :password)
|
|
end
|
|
end
|
|
|