Class: Spree::Admin::PromotionCodesController

Inherits:
BaseController
  • Object
show all
Defined in:
app/controllers/spree/admin/promotion_codes_controller.rb

Instance Method Summary collapse

Instance Method Details

#indexObject



6
7
8
9
10
11
12
13
14
15
16
# File 'app/controllers/spree/admin/promotion_codes_controller.rb', line 6

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