Class: Spud::PasswordResetsController
Instance Method Summary
collapse
#current_site_id, #current_site_name, #sortable
Instance Method Details
#create ⇒ Object
11
12
13
14
15
16
17
18
19
20
21
22
|
# File 'app/controllers/spud/password_resets_controller.rb', line 11
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 new_spud_user_session_url
else
flash[:notice] = "No user was found with that email address"
render :action => :new
end
end
|
#edit ⇒ Object
24
25
26
|
# File 'app/controllers/spud/password_resets_controller.rb', line 24
def edit
render
end
|
#new ⇒ Object
7
8
9
|
# File 'app/controllers/spud/password_resets_controller.rb', line 7
def new
render
end
|
#update ⇒ Object
28
29
30
31
32
33
34
35
36
37
|
# File 'app/controllers/spud/password_resets_controller.rb', line 28
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 new_spud_user_session_url
else
render :action => :edit
end
end
|