def update
      if @existing_code.count > 0
        flash[:notice] = 'Redemption code already exists.'
        render :edit
      else
        if @admin_redeem_code.update(redeem_code_params)
          redirect_to admin_redeem_codes_path, notice: 'Redeem code was successfully updated.'
        else
          render :edit
        end
      end
    end
def update
      if @existing_code.count > 0
        flash[:notice] = 'Redemption code already exists.'
        render :edit
      else
        if @admin_redeem_code.update(redeem_code_params)
          redirect_to admin_redeem_codes_path, notice: 'Redeem code was successfully updated.'
        else
          render :edit
        end
      end
    end
PATCH/PUT /admin/redeem_codes/1