Sha256: de2c5cbc1a899aec0629bf440fc8797f4154ae3e6142a7e6f4c475f9ca9c66f7

Contents?: true

Size: 1.21 KB

Versions: 3

Compression:

Stored size: 1.21 KB

Contents

class Spree::Admin::ZoneCurrenciesController < Spree::Admin::BaseController 

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

	def new
		@zone_currency = ZoneCurrency.new
		@form_target = admin_zone_currencies_path
		@form_method = :post
	end

	def create
		@zone_currency = ZoneCurrency.new(params[:zone_currency])

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

	def edit
		@zone_currency = ZoneCurrency.find(params[:id])
		@form_target = admin_zone_currency_path(@zone_currency)
		@form_method = :put
	end

	def update
		@zone_currency = ZoneCurrency.find(params[:id])

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

	def destroy
		@zone_currency = ZoneCurrency.find(params[:id])

		@zone_currency.destroy
		#cache_reset
		redirect_to admin_zone_currencies_url
	end

end

Version data entries

3 entries across 3 versions & 1 rubygems

Version Path
spree_zone_pricing-0.1.55 app/controllers/spree/admin/zone_currencies_controller.rb
spree_zone_pricing-0.1.54 app/controllers/spree/admin/zone_currencies_controller.rb
spree_zone_pricing-0.1.53 app/controllers/spree/admin/zone_currencies_controller.rb