Module: Hello::Concerns::Management::ForgotPassword

Included in:
Management::ForgotPasswordController
Defined in:
app/controllers/hello/concerns/management/forgot_password.rb

Instance Method Summary collapse

Instance Method Details

#on_failureObject



15
16
17
18
19
20
# File 'app/controllers/hello/concerns/management/forgot_password.rb', line 15

def on_failure
  respond_to do |format|
    format.html { render_form }
    format.json { render json: @forgot_password.errors, status: :unprocessable_entity }
  end
end

#on_successObject



6
7
8
9
10
11
12
13
# File 'app/controllers/hello/concerns/management/forgot_password.rb', line 6

def on_success
  reset_token_and_deliver_emails!

  respond_to do |format|
    format.html { render_success }
    format.json { render json: { sent: true }, status: :created }
  end
end