Sha256: 3acf9751dcb15d1bda69d048b625d9f1d74a103e415c4fccec16943cf2bb7fd0
Contents?: true
Size: 1.05 KB
Versions: 10
Compression:
Stored size: 1.05 KB
Contents
class Admin::PromotionActionsController < Admin::BaseController def create @calculators = Promotion::Actions::CreateAdjustment.calculators @promotion = Promotion.find(params[:promotion_id]) @promotion_action = params[:promotion_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 edit_admin_promotion_path(@promotion)} format.js { render :layout => false } end end def destroy @promotion = 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 edit_admin_promotion_path(@promotion)} format.js { render :layout => false } end end end
Version data entries
10 entries across 10 versions & 1 rubygems