blob: ee0d70ea3516719f1a54231ca8666fab53956af6 (
plain) (
blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
|
class RegistrationsController < ApplicationController
allow_unauthenticated_access only: %i[ new create ]
def new
@user = User.new
end
def create
@user = User.create(user_params)
if @user.save
start_new_session_for @user
redirect_to root_path, notice: "Successfully signed up!"
else
render :new
end
end
private
def user_params
params.expect(user: [:first_name, :last_name, :email_address, :password, :password_confirmation])
end
end
|