Class: ReviseAuth::RegistrationsController

Inherits:
ReviseAuthController show all
Defined in:
app/controllers/revise_auth/registrations_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



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

def create
  @user = User.new()
  if @user.save
    (@user)
    redirect_to resolve_after_register_path
  else
    render :new, status: :unprocessable_entity
  end
end

#destroyObject



30
31
32
33
34
# File 'app/controllers/revise_auth/registrations_controller.rb', line 30

def destroy
  current_user.destroy
  logout
  redirect_to root_path, status: :see_other, alert: t(".account_deleted")
end

#editObject



19
20
# File 'app/controllers/revise_auth/registrations_controller.rb', line 19

def edit
end

#newObject



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

def new
  @user = User.new
end

#updateObject



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

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