Class: UserProfileController

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

Instance Method Summary collapse

Methods inherited from ApplicationController

#not_authenticated, #set_locale

Instance Method Details

#destroyObject


16
17
18
19
# File 'app/controllers/user_profile_controller.rb', line 16

def destroy
  current_user.destroy
  redirect_to root_path, notice: "User was successfully destroyed!"
end

#editObject


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

def edit
end

#showObject


2
3
# File 'app/controllers/user_profile_controller.rb', line 2

def show
end

#updateObject


8
9
10
11
12
13
14
# File 'app/controllers/user_profile_controller.rb', line 8

def update
  if current_user.update(user_params)
    redirect_to profile_path, notice: "User was successfully updated!"
  else
    render :edit
  end
end