Sha256: aa85300fb5d2b2bec76519cfe74b7165c821be2be59d7195356535e487262388

Contents?: true

Size: 544 Bytes

Versions: 21

Compression:

Stored size: 544 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

21 entries across 21 versions & 1 rubygems

Version Path
solidus_backend-2.1.1 app/controllers/spree/admin/promotion_codes_controller.rb
solidus_backend-2.0.3 app/controllers/spree/admin/promotion_codes_controller.rb
solidus_backend-1.4.2 app/controllers/spree/admin/promotion_codes_controller.rb
solidus_backend-1.3.2 app/controllers/spree/admin/promotion_codes_controller.rb
solidus_backend-2.0.2 app/controllers/spree/admin/promotion_codes_controller.rb
solidus_backend-1.4.1 app/controllers/spree/admin/promotion_codes_controller.rb
solidus_backend-2.1.0 app/controllers/spree/admin/promotion_codes_controller.rb
solidus_backend-2.1.0.rc1 app/controllers/spree/admin/promotion_codes_controller.rb
solidus_backend-2.0.1 app/controllers/spree/admin/promotion_codes_controller.rb
solidus_backend-2.1.0.beta1 app/controllers/spree/admin/promotion_codes_controller.rb
solidus_backend-2.0.0 app/controllers/spree/admin/promotion_codes_controller.rb
solidus_backend-1.4.0 app/controllers/spree/admin/promotion_codes_controller.rb
solidus_backend-2.0.0.rc1 app/controllers/spree/admin/promotion_codes_controller.rb
solidus_backend-1.4.0.rc1 app/controllers/spree/admin/promotion_codes_controller.rb
solidus_backend-2.0.0.beta1 app/controllers/spree/admin/promotion_codes_controller.rb
solidus_backend-1.4.0.beta1 app/controllers/spree/admin/promotion_codes_controller.rb
solidus_backend-1.3.1 app/controllers/spree/admin/promotion_codes_controller.rb
solidus_backend-1.3.0 app/controllers/spree/admin/promotion_codes_controller.rb
solidus_backend-1.3.0.rc2 app/controllers/spree/admin/promotion_codes_controller.rb
solidus_backend-1.3.0.rc1 app/controllers/spree/admin/promotion_codes_controller.rb