Skip to content

Instantly share code, notes, and snippets.

@johnivanoff
Created March 8, 2012 02:09
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save johnivanoff/1998071 to your computer and use it in GitHub Desktop.
Save johnivanoff/1998071 to your computer and use it in GitHub Desktop.
# PUT /locations/1
# PUT /locations/1.json
def update
@location = Location.find(params[:id])
respond_to do |format|
if @location.update_attributes(params[:location])
format.html { redirect_to @location, notice: 'Location was successfully updated.' }
format.json { head :ok }
else
format.html { render action: "edit" }
format.json { render json: @location.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