Class: Eventable::OpeningPeriodlistsController

Inherits:
EventableController show all
Defined in:
app/controllers/eventable/opening_periodlists_controller.rb

Instance Method Summary collapse

Instance Method Details

#editObject



11
12
13
14
15
# File 'app/controllers/eventable/opening_periodlists_controller.rb', line 11

def edit
  # you can add a blank/new item like this:
  # @opening_periodlist.add_blank
  try_after_callback
end

#showObject



6
7
8
9
# File 'app/controllers/eventable/opening_periodlists_controller.rb', line 6

def show
  @new_opening_period = @event.opening_periods.build
  try_after_callback
end

#updateObject



17
18
19
20
21
22
23
24
25
26
27
28
# File 'app/controllers/eventable/opening_periodlists_controller.rb', line 17

def update
  if @opening_periodlist.update_attributes(params[:eventable_opening_periodlist])
    try_after_callback do
      flash[:notice] = 'Opening periods were successfully updated.'
      redirect_to(eventable_event_opening_periodlist_path(@event))
    end
  else
    try_after_callback :fail do
      render :action => "edit"
    end
  end
end