Skip to content

Instantly share code, notes, and snippets.

@runemadsen
Created March 18, 2012 16:22
get '/dogs' do
# get a listing of all the dogs
end
get '/dog/:id' do
# just get one dog, you might find him like this:
@dog = Dog.get(params[:id])
# using the params convention, you specified in your route
end
post '/dog' do
# create a new dog listing
end
put '/dog/:id' do
# HTTP PUT request method to update an existing dog
end
delete '/dog/:id' do
# HTTP DELETE request method to remove a dog who's been sold!
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment