Class: RegistrationsController

Inherits:
ApplicationController
  • Object
show all
Defined in:
lib/generators/registration/templates/registrations_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject

[View source]

8
9
10
11
12
13
14
15
16
17
# File 'lib/generators/registration/templates/registrations_controller.rb', line 8

def create
  @user = User.new(user_params)
     
  if @user.save
    start_new_session_for @user
    redirect_to after_authentication_url, notice: "You have successfully registered!"
  else
    render :new, status: :unprocessable_entity
  end
end

#newObject

[View source]

4
5
6
# File 'lib/generators/registration/templates/registrations_controller.rb', line 4

def new
  @user = User.new
end