Skip to content

Commit

Permalink
Added PATCH
Browse files Browse the repository at this point in the history
fixes sinatra/sinatra-book/sinatra#64
  • Loading branch information
kathgironpe committed Nov 18, 2013
1 parent 40cb7c4 commit bea1cfd
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions book/Getting_to_know_Sinatra.markdown
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ HTTP request methods will get you a long ways:

* GET
* POST
* PATCH
* PUT
* DELETE

Expand Down Expand Up @@ -43,6 +44,11 @@ put '/dog/:id' do
# HTTP PUT request method to update an existing dog
end

patch '/dog/:id' do
# HTTP PATCH request method to update an existing dog

This comment has been minimized.

Copy link
@kgrz

kgrz Nov 19, 2013

I think the last word is "doc" :)

This comment has been minimized.

Copy link
@kathgironpe

kathgironpe Nov 19, 2013

Author Owner

@kgrz it's really "dog." I would have changed all occurences of "dog" to "cat" but that would do for an example.

This comment has been minimized.

Copy link
@zzak

zzak Nov 24, 2013

cat > dog

# See RFC 5789 for more information
end

delete '/dog/:id' do
# HTTP DELETE request method to remove a dog who's been sold!
end
Expand All @@ -52,10 +58,11 @@ As you can see from this contrived example, Sinatra's routing is very easy to ge
along with. Don't be fooled, though, Sinatra can do some pretty amazing things
with Routes.

Take a more in-depth look at [Sinatra's routes][routes], and see for yourself.
Take a more in-depth look at [Sinatra's routes][routes], and see for yourself.

[routes]: http://www.sinatrarb.com/intro#Routes
[restful-web-services]: http://en.wikipedia.org/wiki/Representational_State_Transfer#RESTful_web_services
[RFC 5789]: http://www.rfc-base.org/rfc-5789.html

## Filters

Expand Down Expand Up @@ -143,7 +150,7 @@ application:
get '/' do
session['counter'] ||= 0
session['counter'] += 1
"You've hit this page #{session['counter']} times!"
"You've hit this page #{session['counter']} times!"
end
```

Expand Down

0 comments on commit bea1cfd

Please sign in to comment.