app/controllers/users_controller.rb
# Be sure to include AuthenticationSystem in Application Controller instead
Be sure to include AuthenticationSystem in Application Controller instead
Be sure to include AuthenticationSystem in Application Controller instead
def forgot
        if request.post?
            user = User.find_by_email(params[:user][:email])
            if user
                user.create_reset_code
                flash[:notice] = "Reset code sent to #{user.email}"
            else
                flash[:notice] = "#{params[:user][:email]} does not exist in system"
            end
            redirect_back_or_default('/')
        end
    end
def forgot if request . post? user = User . find_by_email ( params [ :user ] [ :email ] ) if user user . create_reset_code flash [ :notice ] = "Reset code sent to #{user.email}" else flash [ :notice ] = "#{params[:user][:email]} does not exist in system" end redirect_back_or_default ( '/' ) end end
Be sure to include AuthenticationSystem in Application Controller instead
Be sure to include AuthenticationSystem in Application Controller instead