Class: ActiveAuthentication::RegistrationsController

Inherits:
ActiveAuthenticationController show all
Defined in:
app/controllers/active_authentication/registrations_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



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

def create
  @user = User.new registration_params

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

#destroyObject



31
32
33
34
35
# File 'app/controllers/active_authentication/registrations_controller.rb', line 31

def destroy
  current_user.destroy
  sign_out
  redirect_to root_url, notice: t(".success")
end

#editObject



20
21
# File 'app/controllers/active_authentication/registrations_controller.rb', line 20

def edit
end

#newObject



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

def new
  @user = User.new
end

#updateObject



23
24
25
26
27
28
29
# File 'app/controllers/active_authentication/registrations_controller.rb', line 23

def update
  if current_user.update(profile_params)
    redirect_to edit_profile_path, notice: t(".success")
  else
    render :edit, status: :unprocessable_entity
  end
end