Class: Gluttonberg::Public::MemberPasswordResetsController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/gluttonberg/public/member_password_resets_controller.rb

Instance Attribute Summary

Attributes inherited from BaseController

#locale, #page

Instance Method Summary collapse

Instance Method Details

#createObject



12
13
14
15
16
17
18
19
20
21
22
23
# File 'app/controllers/gluttonberg/public/member_password_resets_controller.rb', line 12

def create
  @member = Member.find_by_email(params[:gluttonberg_member][:email])
  if @member
    @member.deliver_password_reset_instructions!(current_localization_slug)
    flash[:notice] = "Instructions to reset your password have been emailed to you. " +
    "Please check your email."
    redirect_to root_path
  else
    flash[:notice] = "No member was found with that email address"
    redirect_to root_path
  end
end

#editObject



25
26
27
# File 'app/controllers/gluttonberg/public/member_password_resets_controller.rb', line 25

def edit
  
end

#newObject



9
10
# File 'app/controllers/gluttonberg/public/member_password_resets_controller.rb', line 9

def new
end

#updateObject



29
30
31
32
33
34
35
36
37
38
# File 'app/controllers/gluttonberg/public/member_password_resets_controller.rb', line 29

def update
  @member.password = params[:gluttonberg_member][:password]
  @member.password_confirmation = params[:gluttonberg_member][:password_confirmation]
  if @member.save
    flash[:notice] = "Password successfully updated"
    redirect_to root_path
  else
    render :edit
  end
end