Sha256: 2c7936494443f95a6f8087c20ad3c300e587817dda6ef11f46a19cbc9200e240
Contents?: true
Size: 1.11 KB
Versions: 61
Compression:
Stored size: 1.11 KB
Contents
module Caboose class ProductImagesController < Caboose::ApplicationController #============================================================================= # Admin actions #============================================================================= # GET /admin/product-images/:id/variant-ids def admin_variant_ids return if !user_is_allowed('variants', 'edit') img = ProductImage.find(params[:id]) ids = img.variants.collect{ |v| v.id } render :json => ids end # GET /admin/product-images/:id/variants def admin_variants return if !user_is_allowed('variants', 'edit') img = ProductImage.find(params[:id]) render :json => img.variants end # DELETE /admin/product-images/:id def admin_delete return if !user_is_allowed('variants', 'delete') img = ProductImage.find(params[:id]).destroy render :json => true end # GET /variant-images/:id def variant_images var = Variant.find(params[:id]) img = var.product_images.first render :json => img end end end
Version data entries
61 entries across 61 versions & 1 rubygems