You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: documentation/examples.md
+5-1Lines changed: 5 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -137,6 +137,8 @@ class OrderResource < Webmachine::Resource
137
137
[["application/json", :from_json]]
138
138
end
139
139
140
+
# Note that returning falsey will NOT result in a 404 for PUT requests.
141
+
# See note below.
140
142
defresource_exists?
141
143
order
142
144
end
@@ -166,8 +168,10 @@ class OrderResource < Webmachine::Resource
166
168
end
167
169
```
168
170
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
+
169
173
# 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.
171
175
172
176
# DELETE
173
177
* Override `resource_exists?` and `delete_resource`
0 commit comments