Skip to content

Instantly share code, notes, and snippets.

@johnivanoff
Created January 29, 2012 18:10
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/1699923 to your computer and use it in GitHub Desktop.
Save johnivanoff/1699923 to your computer and use it in GitHub Desktop.
# POST /locations
# POST /locations.json
def create
@location = Location.new(params[:location])
respond_to do |format|
if @location.save
format.html { redirect_to @location, notice: 'Location was successfully created.' }
format.json { render json: @location, status: :created, location: @location }
else
format.html { render action: "new" }
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