Sha256: 025fe037073b59b6e8c6466ec1acdd36c9c25004e8d952b9c3e93b80ba2bcf4f
Contents?: true
Size: 1.08 KB
Versions: 28
Compression:
Stored size: 1.08 KB
Contents
class Spree::Admin::PromotionActionsController < Spree::Admin::BaseController def create @calculators = Spree::Promotion::Actions::CreateAdjustment.calculators @promotion = Spree::Promotion.find(params[:promotion_id]) @promotion_action = params[:action_type].constantize.new(params[:promotion_action]) @promotion_action.promotion = @promotion if @promotion_action.save flash.notice = I18n.t(:successfully_created, :resource => I18n.t(:promotion_action)) end respond_to do |format| format.html { redirect_to spree.edit_admin_promotion_path(@promotion)} format.js { render :layout => false } end end def destroy @promotion = Spree::Promotion.find(params[:promotion_id]) @promotion_action = @promotion.promotion_actions.find(params[:id]) if @promotion_action.destroy flash.notice = I18n.t(:successfully_removed, :resource => I18n.t(:promotion_action)) end respond_to do |format| format.html { redirect_to spree.edit_admin_promotion_path(@promotion)} format.js { render :layout => false } end end end
Version data entries
28 entries across 28 versions & 1 rubygems