Class: Eventable::OpeningTimelistsController
- Inherits:
-
EventableController
- Object
- ApplicationController
- EventableController
- Eventable::OpeningTimelistsController
- Defined in:
- app/controllers/eventable/opening_timelists_controller.rb
Instance Method Summary collapse
Instance Method Details
#edit ⇒ Object
12 13 14 15 16 |
# File 'app/controllers/eventable/opening_timelists_controller.rb', line 12 def edit # you can add a blank/new item like this: # @opening_timelist.add_blank try_after_callback end |
#show ⇒ Object
7 8 9 10 |
# File 'app/controllers/eventable/opening_timelists_controller.rb', line 7 def show @new_opening_time = @opening_period.opening_times.build try_after_callback end |
#update ⇒ Object
18 19 20 21 22 23 24 25 26 27 28 29 |
# File 'app/controllers/eventable/opening_timelists_controller.rb', line 18 def update if @opening_timelist.update_attributes(params[:eventable_opening_timelist]) try_after_callback do flash[:notice] = 'Opening times were successfully updated.' redirect_to(eventable_opening_period_opening_timelist_path(@opening_period)) end else try_after_callback :fail do render :action => "edit" end end end |