Class: Gluttonberg::Public::MemberPasswordResetsController

Inherits:
BaseController 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



15
16
17
18
19
20
21
22
23
24
25
26
# File 'app/controllers/gluttonberg/public/member_password_resets_controller.rb', line 15

def create
  @member = Member.where(:email => params[:gluttonberg_member][:email]).first
  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[:error] = "No member was found with that email address"
    render :new
  end
end

#editObject



28
29
30
31
32
# File 'app/controllers/gluttonberg/public/member_password_resets_controller.rb', line 28

def edit
  respond_to do |format|
    format.html
  end
end

#newObject



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

def new
  respond_to do |format|
    format.html
  end
end

#updateObject



34
35
36
37
38
# File 'app/controllers/gluttonberg/public/member_password_resets_controller.rb', line 34

def update
  @member.password = params[:gluttonberg_member][:password]
  @member.password_confirmation = params[:gluttonberg_member][:password_confirmation]
  generic_update_reset_password(@member, root_path)
end