Class: Admin::FestivityPerformancesController
- Inherits:
-
ResourceController
- Object
- ResourceController
- Admin::FestivityPerformancesController
- Defined in:
- app/controllers/admin/festivity_performances_controller.rb
Instance Method Summary collapse
Instance Method Details
#create ⇒ Object
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.where(site_id: event.site.id) } else render status: :bad_request end end |
#destroy ⇒ Object
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 |