Class: Eventable::PricelistsController

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

Instance Method Summary collapse

Instance Method Details

#editObject



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

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

#showObject



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

def show
  @new_price = @event.prices.build
  try_after_callback
end

#updateObject



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

def update
  if @pricelist.update_attributes(params[:eventable_pricelist])
    try_after_callback do
      flash[:notice] = 'Prices were successfully updated.'
      redirect_to(eventable_event_pricelist_path(@event))
    end
  else
    try_after_callback :fail do
      render :action => "edit"
    end
  end
end