osem-fcy/app/controllers/admin/venue_photos_controller.rb
David Sedeño 7c0cd30dda Add venue_photos model and venue_photos admin controller in order to add more images to Venues and allow to delete it.
Show the additional photos in splash. Added fancybox gem for zoom when click on the additional photo.

fix #777
2016-02-13 17:39:30 +01:00

15 lines
554 B
Ruby

module Admin
class VenuePhotosController < Admin::BaseController
load_and_authorize_resource :conference, find_by: :short_title
load_and_authorize_resource :venue, through: :conference, singleton: true
def destroy
photo = @venue.venue_photos.find(params[:id])
if photo.destroy
redirect_to edit_admin_conference_venue_path(@conference.short_title), notice: 'Photo deleted'
else
redirect_to edit_admin_conference_venue_path(@conference.short_title), alert: 'Photo not deleted'
end
end
end
end