Bildergallerie auf Kurs

Für alle mit löschrechten: 2 Buttons, einer zeigt auf originaldatei,
einer löscht das bild.
This commit is contained in:
Thomas Blazek
2015-01-16 14:41:37 +01:00
parent 9c6038d6dd
commit b7f9cf942b
4 changed files with 92 additions and 57 deletions

View File

@@ -87,10 +87,11 @@ class FotosController < ApplicationController
# DELETE /fotos/1.json
def destroy
@foto = Foto.find(params[:id])
gallery = @foto.gallery_id
@foto.destroy
respond_to do |format|
format.html { redirect_to galleries_url }
format.html { redirect_to gallery_path(gallery) }
format.json { head :no_content }
end
end