Last active
August 29, 2015 14:22
-
-
Save fabrinal/400cba9e2e355843ccc5 to your computer and use it in GitHub Desktop.
add compare method after update method executed
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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