Sha256: ae1c5ae17e75d07210b7fe92d16f3297d80c7fde3747cf4619f39d4209f0d1d5

Contents?: true

Size: 1.23 KB

Versions: 36

Compression:

Stored size: 1.23 KB

Contents

class Spree::Admin::CurrencyPricesController < Spree::Admin::BaseController 

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

	def new
		@currency_price = CurrencyPrice.new
		@form_target = admin_currency_prices_path
		@form_method = :post
	end

	def create
		@currency_price = CurrencyPrice.new(params[:currency_price])

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

	def edit
		@currency_price = CurrencyPrice.find(params[:id])
		@form_target = admin_currency_price_path(@currency_price)
		@form_method = :put
	end

	def update
		@currency_price = CurrencyPrice.find(params[:id])

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

	def destroy
		@currency_price = CurrencyPrice.find(params[:id])

		@currency_price.destroy
		#cache_reset
		redirect_to admin_currency_prices_url
	end

end

Version data entries

36 entries across 36 versions & 1 rubygems

Version Path
spree_zone_pricing-0.1.90 app/controllers/spree/admin/currency_prices_controller.rb
spree_zone_pricing-0.1.89 app/controllers/spree/admin/currency_prices_controller.rb
spree_zone_pricing-0.1.87 app/controllers/spree/admin/currency_prices_controller.rb
spree_zone_pricing-0.1.86 app/controllers/spree/admin/currency_prices_controller.rb
spree_zone_pricing-0.1.85 app/controllers/spree/admin/currency_prices_controller.rb
spree_zone_pricing-0.1.84 app/controllers/spree/admin/currency_prices_controller.rb
spree_zone_pricing-0.1.83 app/controllers/spree/admin/currency_prices_controller.rb
spree_zone_pricing-0.1.82 app/controllers/spree/admin/currency_prices_controller.rb
spree_zone_pricing-0.1.81 app/controllers/spree/admin/currency_prices_controller.rb
spree_zone_pricing-0.1.80 app/controllers/spree/admin/currency_prices_controller.rb
spree_zone_pricing-0.1.79 app/controllers/spree/admin/currency_prices_controller.rb
spree_zone_pricing-0.1.78 app/controllers/spree/admin/currency_prices_controller.rb
spree_zone_pricing-0.1.77 app/controllers/spree/admin/currency_prices_controller.rb
spree_zone_pricing-0.1.76 app/controllers/spree/admin/currency_prices_controller.rb
spree_zone_pricing-0.1.75 app/controllers/spree/admin/currency_prices_controller.rb
spree_zone_pricing-0.1.74 app/controllers/spree/admin/currency_prices_controller.rb
spree_zone_pricing-0.1.73 app/controllers/spree/admin/currency_prices_controller.rb
spree_zone_pricing-0.1.72 app/controllers/spree/admin/currency_prices_controller.rb
spree_zone_pricing-0.1.71 app/controllers/spree/admin/currency_prices_controller.rb
spree_zone_pricing-0.1.70 app/controllers/spree/admin/currency_prices_controller.rb