Sha256: c0e101d8fd612f2ac9125f25a7c4a6b87072b23c47db9b59b6f49b71d82cf28d

Contents?: true

Size: 545 Bytes

Versions: 28

Compression:

Stored size: 545 Bytes

Contents

module Spree
  module Admin
    class PromotionCodesController < Spree::Admin::BaseController
      require 'csv'

      def index
        @promotion = Spree::Promotion.accessible_by(current_ability, :read).find(params[:promotion_id])

        respond_to do |format|
          format.csv do
            filename = "promotion-code-list-#{@promotion.id}.csv"
            headers["Content-Type"] = "text/csv"
            headers["Content-disposition"] = "attachment; filename=\"#{filename}\""
          end
        end
      end

    end
  end
end

Version data entries

28 entries across 28 versions & 1 rubygems

Version Path
solidus_backend-1.0.2 app/controllers/spree/admin/promotion_codes_controller.rb
solidus_backend-1.0.1 app/controllers/spree/admin/promotion_codes_controller.rb
solidus_backend-1.0.0 app/controllers/spree/admin/promotion_codes_controller.rb
solidus_backend-1.0.0.rc2 app/controllers/spree/admin/promotion_codes_controller.rb
solidus_backend-1.0.0.rc1 app/controllers/spree/admin/promotion_codes_controller.rb
solidus_backend-1.0.0.pre3 app/controllers/spree/admin/promotion_codes_controller.rb
solidus_backend-1.0.0.pre2 app/controllers/spree/admin/promotion_codes_controller.rb
solidus_backend-1.0.0.pre app/controllers/spree/admin/promotion_codes_controller.rb