Class: RegistrationsController

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

Instance Method Summary collapse

Instance Method Details

#createObject



8
9
10
11
12
13
14
15
16
17
18
# File 'app/controllers/registrations_controller.rb', line 8

def create
  @user = User.new(user_params)
  Studio.configure_new_user.call(@user)
  rescue_and_log(target: @user) do
    @user.save!
    set_app_session(@user)
    redirect_to root_path, notice: Studio.welcome_message.call(@user)
  end
rescue StandardError => e
  render :new, status: :unprocessable_entity
end

#newObject



4
5
6
# File 'app/controllers/registrations_controller.rb', line 4

def new
  @user = User.new
end