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.7 app/controllers/admin/promotion_rules_controller.rb
spree_promo-0.70.6 app/controllers/admin/promotion_rules_controller.rb
apispree_promo-0.0.0 app/controllers/admin/promotion_rules_controller.rb
My-Commerce_promo-1.1.0 app/controllers/admin/promotion_rules_controller.rb
My-Commerce_promo-1.0.0 app/controllers/admin/promotion_rules_controller.rb
MyCommerceapi-1.0.0 promo/app/controllers/admin/promotion_rules_controller.rb
MyCommerce-0.0.3 promo/app/controllers/admin/promotion_rules_controller.rb
rfcommerce_promo-0.0.3 app/controllers/admin/promotion_rules_controller.rb
spree_promo-0.60.6 app/controllers/admin/promotion_rules_controller.rb
spree_promo-0.70.5 app/controllers/admin/promotion_rules_controller.rb
spree_promo-0.70.4 app/controllers/admin/promotion_rules_controller.rb
spree_promo-0.60.5 app/controllers/admin/promotion_rules_controller.rb
spree_promo-0.70.3 app/controllers/admin/promotion_rules_controller.rb
spree_promo-0.70.2 app/controllers/admin/promotion_rules_controller.rb
spree_promo-0.60.4 app/controllers/admin/promotion_rules_controller.rb
spree_promo-0.60.3 app/controllers/admin/promotion_rules_controller.rb
spree_promo-0.70.1 app/controllers/admin/promotion_rules_controller.rb
spree_promo-0.70.0 app/controllers/admin/promotion_rules_controller.rb
spree_promo-0.60.2 app/controllers/admin/promotion_rules_controller.rb
spree_promo-0.70.0.rc2 app/controllers/admin/promotion_rules_controller.rb