Class: SimplyAuth::RegistrationsController

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

Instance Method Summary collapse

Instance Method Details

#after_registration(user) ⇒ Object



7
# File 'app/controllers/simply_auth/registrations_controller.rb', line 7

def after_registration(user); end

#createObject



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

def create
  @user = SimplyAuth::User.new(user_params)
  if @user.save
    after_registration(@user)

    @session = SimplyAuth::Session.new(email: user_params[:email], password: user_params[:password])
    @session.save
    session[:simply_auth_session_id] = @session.id
    redirect_to "/"
  else
    render :new
  end
end

#newObject



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

def new
  @user = SimplyAuth::User.new
end