Sha256: f87690ca77d143910a4477405e91de0c669d8fb1581d010c845fd8137a8cff11

Contents?: true

Size: 985 Bytes

Versions: 26

Compression:

Stored size: 985 Bytes

Contents

class Admin::PromotionRulesController < Admin::BaseController
  def create
    @promotion = Promotion.find(params[:promotion_id])
    @promotion_rule = params[:promotion_rule][:type].constantize.new(params[:promotion_rule])
    @promotion_rule.promotion = @promotion
    if @promotion_rule.save
      flash[:notice] = I18n.t(:successfully_created, :resource => I18n.t(:promotion_rule))
    end
    respond_to do |format|
      format.html { redirect_to edit_admin_promotion_path(@promotion)}
      format.js   { render :layout => false }
    end
  end
  
  def destroy
    @promotion = Promotion.find(params[:promotion_id])
    @promotion_rule = @promotion.promotion_rules.find(params[:id])
    if @promotion_rule.destroy
      flash[:notice] = I18n.t(:successfully_removed, :resource => I18n.t(:promotion_rule))
    end
    respond_to do |format|
      format.html { redirect_to edit_admin_promotion_path(@promotion)}
      format.js   { render :layout => false }
    end  
  end
end

Version data entries

26 entries across 26 versions & 7 rubygems

Version Path
spree_promo-0.70.RC1 app/controllers/admin/promotion_rules_controller.rb
spree_bushido_promo-0.80.28 app/controllers/admin/promotion_rules_controller.rb
spree_bushido_promo-0.80.27 app/controllers/admin/promotion_rules_controller.rb
spree_promo-0.60.1 app/controllers/admin/promotion_rules_controller.rb
spree_promo-0.60.0 app/controllers/admin/promotion_rules_controller.rb
spree_promo-0.60.0.RC1 app/controllers/admin/promotion_rules_controller.rb