Class: PasswordResetsController

Inherits:
Spree::BaseController show all
Defined in:
app/controllers/password_resets_controller.rb

Instance Method Summary collapse

Methods inherited from Spree::BaseController

#access_forbidden, #default_title, #find_order, #initialize_extension_partials, #set_title, #title

Methods inherited from ApplicationController

#admin_created?

Methods included from EasyRoleRequirementSystem

included

Methods included from EasyRoleRequirementSystem::InstanceMethods

#included

Methods included from RoleRequirementSystem

included

Instance Method Details

#createObject



9
10
11
12
13
14
15
16
17
18
19
# File 'app/controllers/password_resets_controller.rb', line 9

def create
  @user = User.find_by_email(params[:email])
  if @user
    @user.deliver_password_reset_instructions!
    flash[:notice] = t("password_reset_instructions_are_mailed")
    redirect_to root_url
  else
    flash[:notice] = t("no_user_found")
    render :action => :new
  end
end

#editObject



21
22
23
# File 'app/controllers/password_resets_controller.rb', line 21

def edit
  render
end

#newObject



5
6
7
# File 'app/controllers/password_resets_controller.rb', line 5

def new
  render
end

#updateObject



25
26
27
28
29
30
31
32
33
34
# File 'app/controllers/password_resets_controller.rb', line 25

def update
  @user.password = params[:user][:password]
  @user.password_confirmation = params[:user][:password_confirmation]
  if @user.save
    flash[:notice] = t("password_updated")
    redirect_to 
  else
    render :action => :edit
  end
end