Class: Admin::FestivityPerformancesController

Inherits:
ResourceController
  • Object
show all
Defined in:
app/controllers/admin/festivity_performances_controller.rb

Instance Method Summary collapse

Instance Method Details

#createObject



2
3
4
5
6
7
8
9
10
11
# File 'app/controllers/admin/festivity_performances_controller.rb', line 2

def create
  event = FestivityEventPage.find(params[:event_page_id])
  performance = event.festivity_performances.new
  if performance.save
    render partial: 'admin/pages/partials/performance', :locals => { :performance => performance, :locations => FestivityLocationPage.all }
  else
    render status: :bad_request
  end

end

#destroyObject



13
14
15
16
17
18
19
# File 'app/controllers/admin/festivity_performances_controller.rb', line 13

def destroy
  performance = FestivityPerformance.find(params[:id])
  page_id = performance.festivity_event_page.id
  if performance.destroy
    render partial: 'admin/pages/partials/performances_table', :locals => { :performances => FestivityEventPage.find(page_id).festivity_performances, :page_id => page_id, locations: FestivityLocationPage.all}
  end
end