Class: Eventable::PricesController
- Inherits:
-
EventableController
- Object
- ApplicationController
- EventableController
- Eventable::PricesController
- Defined in:
- app/controllers/eventable/prices_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 |
# File 'app/controllers/eventable/prices_controller.rb', line 9 def create if @price.update_attributes(params[:eventable_price]) try_after_callback do flash[:notice] = 'Price was successfully added.' redirect_to (if params[:list] eventable_event_pricelist_path @event else eventable_event_price_path @event, @price end) end else try_after_callback :fail do render :action => "new" end end end |
#destroy ⇒ Object
43 44 45 46 47 48 49 50 51 52 |
# File 'app/controllers/eventable/prices_controller.rb', line 43 def destroy @price.destroy try_after_callback do redirect_to (if params[:list] eventable_event_pricelist_path @event else eventable_event_prices_path @event end) end end |
#update ⇒ Object
26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 |
# File 'app/controllers/eventable/prices_controller.rb', line 26 def update if @price.update_attributes(params[:eventable_price]) try_after_callback do flash[:notice] = 'Price was successfully updated.' redirect_to (if params[:list] eventable_event_pricelist_path @event else eventable_event_price_path @event, @price end) end else try_after_callback :fail do render :action => "edit" end end end |