core/app/controllers/admin/variants_controller.rb
def destroy
    @variant = Variant.find(params[:id])
      
    @variant.deleted_at = Time.now()
    if @variant.save
      flash.notice = I18n.t("notice_messages.variant_deleted")
    else
      flash.notice = I18n.t("notice_messages.variant_not_deleted")
    end

    respond_to do |format|
      format.html { redirect_to admin_product_variants_url(params[:product_id]) }
      format.js  { render_js_for_destroy }
    end
  end
# override the destory method to set deleted_at value 
# instead of actually deleting the product.
override the destory method to set deleted_at value
instead of actually deleting the product.
override the destory method to set deleted_at value instead of actually deleting the product .
def destroy
    @variant = Variant.find(params[:id])
    @variant.deleted_at = Time.now()
    if @variant.save
      flash.notice = I18n.t("notice_messages.variant_deleted")
    else
      flash.notice = I18n.t("notice_messages.variant_not_deleted")
    end
    respond_to do |format|
      format.html { redirect_to admin_product_variants_url(params[:product_id]) }
      format.js  { render_js_for_destroy }
    end
  end
def destroy @variant = Variant . find ( params [ :id ] ) @variant . deleted_at = Time . now ( ) if @variant . save flash . notice = I18n . t ( "notice_messages.variant_deleted" ) else flash . notice = I18n . t ( "notice_messages.variant_not_deleted" ) end respond_to do | format | format . html { redirect_to admin_product_variants_url ( params [ :product_id ] ) } format . js { render_js_for_destroy } end end
override the destory method to set deleted_at value
instead of actually deleting the product.
override the destory method to set deleted_at value instead of actually deleting the product .