Class: Spud::Admin::PasswordResetsController

Inherits:
Spud::ApplicationController
  • Object
show all
Defined in:
app/controllers/spud/admin/password_resets_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



12
13
14
15
16
17
18
19
20
21
22
23
# File 'app/controllers/spud/admin/password_resets_controller.rb', line 12

def create
  @user = SpudUser.find_by_email(params[:email])
  if @user
    Spud::CoreMailer.forgot_password_notification(@user).deliver
    flash[:notice] = "Instructions to reset your password have been emailed to you. " +
    "Please check your email."
    redirect_to 
  else
    flash[:notice] = "No user was found with that email address"
    render 'index'
  end
end

#indexObject



8
9
10
# File 'app/controllers/spud/admin/password_resets_controller.rb', line 8

def index

end

#showObject



25
26
27
# File 'app/controllers/spud/admin/password_resets_controller.rb', line 25

def show

end

#updateObject



29
30
31
32
33
34
35
36
37
38
# File 'app/controllers/spud/admin/password_resets_controller.rb', line 29

def update
  @user.password = params[:spud_user][:password]
  @user.password_confirmation = params[:spud_user][:password_confirmation]
  if @user.save
    flash[:notice] = "Password successfully updated"
    redirect_to 
  else
    render 'show'
  end
end