app/controllers/grandstand/images_controller.rb in grandstand-0.2.7 vs app/controllers/grandstand/images_controller.rb in grandstand-0.3.0
- old
+ new
@@ -5,12 +5,16 @@
# session :cookies_only => false, :only => :create
def create
@image = @gallery.images.new(params[:image])
if @image.save
- flash[:success] = 'Your image was successfully uploaded'
- params.has_key?('Filename') || request.xhr? ? render(:json => {:status => :ok}) : redirect_to(grandstand_gallery_path(@gallery))
+ if params.has_key?('Filename') || request.xhr?
+ render(:json => {:status => :ok})
+ else
+ flash[:success] = 'Your image was successfully uploaded'
+ redirect_to(grandstand_gallery_path(@gallery))
+ end
else
render :new
end
end
@@ -49,10 +53,12 @@
else
render :new
end
end
- def upload
+ if Grandstand.multiple_upload
+ def upload
+ end
end
protected
def find_image
@image = @gallery.images.find(params[:id])