Skip to content

Instantly share code, notes, and snippets.

@fabrinal
Last active August 29, 2015 14:22
Show Gist options
  • Save fabrinal/400cba9e2e355843ccc5 to your computer and use it in GitHub Desktop.
Save fabrinal/400cba9e2e355843ccc5 to your computer and use it in GitHub Desktop.
add compare method after update method executed
def update
respond_to do |format|
if @photo_gallery.update(photo_gallery_params)
# add compare method in here
compare_photos(params[:photos])
format.html { redirect_to @photo_gallery, notice: 'Photo gallery was successfully updated.' }
format.json { render :show, status: :ok, location: @photo_gallery }
else
format.html { render :edit }
format.json { render json: @photo_gallery.errors, status: :unprocessable_entity }
end
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment