Sha256: 50c740a26e76a5b7a0c014dcda5a01a89d31c7746390b9836233dd714d541562

Contents?: true

Size: 1.12 KB

Versions: 36

Compression:

Stored size: 1.12 KB

Contents

class Spree::Admin::ZonePricesController < Spree::Admin::BaseController 

	def index
		@zone_prices = ZonePrice.page(params[:page]||1).per(20)
	end

	def new
		@zone_price = ZonePrice.new
		@form_target = admin_zone_prices_path
		@form_method = :post
	end

	def create
		@zone_price = ZonePrice.new(params[:zone_price])

		if @zone_price.save
			#cache_reset
			redirect_to admin_zone_prices_path, notice: 'Item was successfully created.'
		else
			@form_target = admin_zone_prices_path
			@form_method = :post
			render action: "new"
		end
	end

	def edit
		@zone_price = ZonePrice.find(params[:id])
		@form_target = admin_zone_price_path(@zone_price)
		@form_method = :put
	end

	def update
		@zone_price = ZonePrice.find(params[:id])

		if @zone_price.update_attributes(params[:zone_price])
			#cache_reset
			redirect_to admin_zone_prices_path, notice: 'Item was successfully updated.'
		else
			@form_target = admin_zone_price_path(@zone_price)
			@form_method = :put
			render action: "edit"
		end
	end

	def destroy
		@zone_price = ZonePrice.find(params[:id])

		@zone_price.destroy
		#cache_reset
		redirect_to admin_zone_prices_url
	end

end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
spree_zone_pricing-0.1.52 app/controllers/spree/admin/zone_prices_controller.rb
spree_zone_pricing-0.1.51 app/controllers/spree/admin/zone_prices_controller.rb
spree_zone_pricing-0.1.50 app/controllers/spree/admin/zone_prices_controller.rb
spree_zone_pricing-0.1.49 app/controllers/spree/admin/zone_prices_controller.rb
spree_zone_pricing-0.1.48 app/controllers/spree/admin/zone_prices_controller.rb
spree_zone_pricing-0.1.47 app/controllers/spree/admin/zone_prices_controller.rb
spree_zone_pricing-0.1.46 app/controllers/spree/admin/zone_prices_controller.rb
spree_zone_pricing-0.1.45 app/controllers/spree/admin/zone_prices_controller.rb
spree_zone_pricing-0.1.44 app/controllers/spree/admin/zone_prices_controller.rb
spree_zone_pricing-0.1.43 app/controllers/spree/admin/zone_prices_controller.rb
spree_zone_pricing-0.1.42 app/controllers/spree/admin/zone_prices_controller.rb
spree_zone_pricing-0.1.41 app/controllers/spree/admin/zone_prices_controller.rb
spree_zone_pricing-0.1.40 app/controllers/spree/admin/zone_prices_controller.rb
spree_zone_pricing-0.1.39 app/controllers/spree/admin/zone_prices_controller.rb
spree_zone_pricing-0.1.38 app/controllers/spree/admin/zone_prices_controller.rb
spree_zone_pricing-0.1.37 app/controllers/spree/admin/zone_prices_controller.rb
spree_zone_pricing-0.1.36 app/controllers/spree/admin/zone_prices_controller.rb
spree_zone_pricing-0.1.35 app/controllers/spree/admin/zone_prices_controller.rb
spree_zone_pricing-0.1.34 app/controllers/spree/admin/zone_prices_controller.rb
spree_zone_pricing-0.1.33 app/controllers/spree/admin/zone_prices_controller.rb