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

Version Path
caboose-cms-0.5.64 app/controllers/caboose/product_images_controller.rb
caboose-cms-0.5.63 app/controllers/caboose/product_images_controller.rb
caboose-cms-0.5.62 app/controllers/caboose/product_images_controller.rb
caboose-cms-0.5.61 app/controllers/caboose/product_images_controller.rb
caboose-cms-0.5.60 app/controllers/caboose/product_images_controller.rb
caboose-cms-0.5.59 app/controllers/caboose/product_images_controller.rb
caboose-cms-0.5.58 app/controllers/caboose/product_images_controller.rb
caboose-cms-0.5.57 app/controllers/caboose/product_images_controller.rb
caboose-cms-0.5.56 app/controllers/caboose/product_images_controller.rb
caboose-cms-0.5.55 app/controllers/caboose/product_images_controller.rb
caboose-cms-0.5.54 app/controllers/caboose/product_images_controller.rb
caboose-cms-0.5.53 app/controllers/caboose/product_images_controller.rb
caboose-cms-0.5.52 app/controllers/caboose/product_images_controller.rb
caboose-cms-0.5.51 app/controllers/caboose/product_images_controller.rb
caboose-cms-0.5.50 app/controllers/caboose/product_images_controller.rb
caboose-cms-0.5.49 app/controllers/caboose/product_images_controller.rb
caboose-cms-0.5.48 app/controllers/caboose/product_images_controller.rb
caboose-cms-0.5.47 app/controllers/caboose/product_images_controller.rb
caboose-cms-0.5.46 app/controllers/caboose/product_images_controller.rb
caboose-cms-0.5.45 app/controllers/caboose/product_images_controller.rb