Class: Shoppe::DeliveryServicePricesController
- Inherits:
-
ApplicationController
- Object
- ActionController::Base
- ApplicationController
- Shoppe::DeliveryServicePricesController
- Defined in:
- app/controllers/shoppe/delivery_service_prices_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
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 |
#destroy ⇒ Object
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 |
#index ⇒ Object
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 |
#new ⇒ Object
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 |
#update ⇒ Object
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 |