Sha256: e1b4ac7329654be4cc98571615e4b9129f3d45a1ac58d9d56800f53fead551ec
Contents?: true
Size: 711 Bytes
Versions: 22
Compression:
Stored size: 711 Bytes
Contents
require 'csv' module Spree module Admin class PromotionCodesController < Spree::Admin::ResourceController def index @promotion = Spree::Promotion.accessible_by(current_ability, :read).find(params[:promotion_id]) @promotion_codes = @promotion.promotion_codes respond_to do |format| format.html do @promotion_codes = @promotion_codes.page(params[:page]).per(50) end 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
22 entries across 22 versions & 1 rubygems