Class: Shoppe::DeliveryServicePricesController

Inherits:
ApplicationController show all
Defined in:
app/controllers/shoppe/delivery_service_prices_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject


16
17
18
19
20
21
22
23
# File 'app/controllers/shoppe/delivery_service_prices_controller.rb', line 16

def create
  @delivery_service_price = @delivery_service.delivery_service_prices.build(safe_params)
  if @delivery_service_price.save
    redirect_to [@delivery_service, :delivery_service_prices], :notice => t('shoppe.delivery_service_prices.create_notice')
  else
    render :action => "new"
  end
end

#destroyObject


33
34
35
36
# File 'app/controllers/shoppe/delivery_service_prices_controller.rb', line 33

def destroy
  @delivery_service_price.destroy
  redirect_to [@delivery_service, :delivery_service_prices], :notice => t('shoppe.delivery_service_prices.destroy_notice')
end

#indexObject


8
9
10
# File 'app/controllers/shoppe/delivery_service_prices_controller.rb', line 8

def index
  @delivery_service_prices = @delivery_service.delivery_service_prices.ordered
end

#newObject


12
13
14
# File 'app/controllers/shoppe/delivery_service_prices_controller.rb', line 12

def new
  @delivery_service_price = @delivery_service.delivery_service_prices.build
end

#updateObject


25
26
27
28
29
30
31
# File 'app/controllers/shoppe/delivery_service_prices_controller.rb', line 25

def update
  if @delivery_service_price.update(safe_params)
    redirect_to [@delivery_service, :delivery_service_prices], :notice => t('shoppe.delivery_service_prices.update_notice')
  else
    render :action => "edit"
  end
end