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



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

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 => "Price has been created successfully"
  else
    render :action => "new"
  end
end

#destroyObject



31
32
33
34
# File 'app/controllers/shoppe/delivery_service_prices_controller.rb', line 31

def destroy
  @delivery_service_price.destroy
  redirect_to [@delivery_service, :delivery_service_prices], :notice => "Price has been removed successfully"
end

#indexObject



6
7
8
# File 'app/controllers/shoppe/delivery_service_prices_controller.rb', line 6

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

#newObject



10
11
12
# File 'app/controllers/shoppe/delivery_service_prices_controller.rb', line 10

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

#updateObject



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

def update
  if @delivery_service_price.update(safe_params)
    redirect_to [@delivery_service, :delivery_service_prices], :notice => "Price has been updated successfully"
  else
    render :action => "edit"
  end
end