app/controllers/passwords_controller.rb
# Action triggered by clicking on the /reset_password/:id link recieved via email
# Makes sure the id code is included
# Checks that the id code matches a user in the database
# Then if everything checks out, shows the password reset fields
Action triggered by clicking on the /reset_password/:id link recieved via email
Makes sure the id code is included
Checks that the id code matches a user in the database
Then if everything checks out, shows the password reset fields
Action triggered by clicking on the / reset_password / : id link recieved via email Makes sure the id code is included Checks that the id code matches a user in the database Then if everything checks out shows the password reset fields
def edit
    if params[:id].nil?
      render :template=>"passwords/new"
    else
      @user = User.find_by_password_reset_code(params[:id]) if params[:id]
      raise if @user.nil?
    end
  rescue
    flash[:notice] = "Sorry - That is an invalid password reset code. Please check your code and try again. (Perhaps your email client inserted a carriage return?)"
    redirect_to new_session_path
  end
def edit if params [ :id ] . nil? render :template => "passwords/new" else @user = User . find_by_password_reset_code ( params [ :id ] ) if params [ :id ] raise if @user . nil? end rescue flash [ :notice ] = "Sorry - That is an invalid password reset code. Please check your code and try again. (Perhaps your email client inserted a carriage return?)" redirect_to new_session_path end
Action triggered by clicking on the /reset_password/:id link recieved via email
Makes sure the id code is included
Checks that the id code matches a user in the database
Then if everything checks out, shows the password reset fields
Action triggered by clicking on the / reset_password / : id link recieved via email Makes sure the id code is included Checks that the id code matches a user in the database Then if everything checks out shows the password reset fields