Class: Kiqr::Users::Settings::PasswordsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/kiqr/users/settings/passwords_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



26
27
28
29
30
31
32
33
34
# File 'app/controllers/kiqr/users/settings/passwords_controller.rb', line 26

def create
  if @user.create_password(user_password_params)
    kiqr_flash_message :success, :password_created
    (@user) if 
    redirect_to 
  else
    render :new, status: :unprocessable_content
  end
end

#showObject

GET /settings/profile



8
9
10
11
12
13
14
# File 'app/controllers/kiqr/users/settings/passwords_controller.rb', line 8

def show
  if @user.encrypted_password.blank?
    render :new
  else
    render :edit
  end
end

#updateObject



16
17
18
19
20
21
22
23
24
# File 'app/controllers/kiqr/users/settings/passwords_controller.rb', line 16

def update
  if @user.update_with_password(user_password_params)
    kiqr_flash_message :success, :password_updated
    (@user) if 
    redirect_to 
  else
    render :edit, status: :unprocessable_content
  end
end