Skip to content

Commit bc7b147

Browse files
committed
Added comments about PUT to a non-existent resource.
1 parent 3fa8119 commit bc7b147

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

documentation/examples.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -137,6 +137,8 @@ class OrderResource < Webmachine::Resource
137137
[["application/json", :from_json]]
138138
end
139139

140+
# Note that returning falsey will NOT result in a 404 for PUT requests.
141+
# See note below.
140142
def resource_exists?
141143
order
142144
end
@@ -166,8 +168,10 @@ class OrderResource < Webmachine::Resource
166168
end
167169
```
168170

171+
If you wish to disallow PUT to a non-existent resource, read more [here](https://github.com/webmachine/webmachine-ruby/issues/207#issuecomment-132604379).
172+
169173
# PATCH
170-
* Webmachine does not currently support PATCH requests. See https://github.com/seancribbs/webmachine-ruby/issues/109 for more information and https://github.com/bethesque/pact_broker/blob/2918814e70bbda14df68598a6a41502a5eac4308/lib/pact_broker/api/resources/pacticipant.rb for a dirty hack to make it work if you need to.
174+
* Webmachine does not currently support PATCH requests. See https://github.com/webmachine/webmachine-ruby/issues/109 for more information and https://github.com/bethesque/pact_broker/blob/2918814e70bbda14df68598a6a41502a5eac4308/lib/pact_broker/api/resources/pacticipant.rb for a dirty hack to make it work if you need to.
171175

172176
# DELETE
173177
* Override `resource_exists?` and `delete_resource`

0 commit comments

Comments
 (0)