Class: Avocado::RegistrationsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/avocado/registrations_controller.rb

Constant Summary collapse

INITIALIZATION_PARAMETERS =
%i[email password password_confirmation]

Constants inherited from BaseController

BaseController::FINDER_PARAMETERS

Instance Method Summary collapse

Instance Method Details

#createObject



11
12
13
14
15
16
17
18
19
20
21
22
23
# File 'app/controllers/avocado/registrations_controller.rb', line 11

def create
  @user = ::User.new(initialization_parameters)

  if @user.save
    (@user)

    send_email_verification(@user)
    redirect_to root_path,
      notice: t(".success")
  else
    render :new, status: :unprocessable_entity
  end
end

#newObject



7
8
9
# File 'app/controllers/avocado/registrations_controller.rb', line 7

def new
  @user = ::User.new
end