Sha256: 4746e57ab58c3d6fbb12432026dc1e0f1065152e78ea34341f820d3e66fc2b19

Contents?: true

Size: 580 Bytes

Versions: 8

Compression:

Stored size: 580 Bytes

Contents

class Admin::PromotionsController < Admin::BaseController
  resource_controller         
  before_filter :load_data

  update.wants.html { redirect_to edit_object_url }
  create.wants.html { redirect_to edit_object_url }
  destroy.success.wants.js { render_js_for_destroy }

  private       
  def build_object
    @object ||= end_of_association_chain.send parent? ? :build : :new, object_params 
    @object.calculator = params[:promotion][:calculator_type].constantize.new if params[:promotion]
  end
  
  def load_data     
    @calculators = Promotion.calculators
  end  
end

Version data entries

8 entries across 8 versions & 1 rubygems

Version Path
spree_promo-0.30.2 app/controllers/admin/promotions_controller.rb
spree_promo-0.40.4 app/controllers/admin/promotions_controller.rb
spree_promo-0.40.3 app/controllers/admin/promotions_controller.rb
spree_promo-0.40.2 app/controllers/admin/promotions_controller.rb
spree_promo-0.40.1 app/controllers/admin/promotions_controller.rb
spree_promo-0.40.0 app/controllers/admin/promotions_controller.rb
spree_promo-0.30.1 app/controllers/admin/promotions_controller.rb
spree_promo-0.30.0 app/controllers/admin/promotions_controller.rb