work in progress

This commit is contained in:
Thomas Blazek
2015-01-16 00:03:09 +01:00
parent 978d923082
commit 75667ae6ce
6 changed files with 41 additions and 27 deletions

View File

@@ -18,7 +18,7 @@ class GalleriesController < ApplicationController
# GET /galleries/1.json
def show
@gallery = Gallery.find(params[:id])
@pppage_array = [ 25 , 50 , 100 ] #defines number & size of picture chunks
@pppage = 0 #starting index of pppage_array
@@ -56,6 +56,7 @@ class GalleriesController < ApplicationController
# GET /galleries/1/edit
def edit
@gallery = Gallery.find(params[:id])
@fotos_old = @gallery.fotos
end
# POST /galleries
@@ -81,6 +82,10 @@ class GalleriesController < ApplicationController
@foto = Foto.new
respond_to do |format|
if @gallery.update_attributes(params[:gallery])
Foto.where(:gallery_id=>nil).each do |tbd|
tbd.destroy
end
format.html { redirect_to @gallery, notice: 'Gallery was successfully updated.' }
format.json { head :no_content }
else