lib/restful_resource/base.rb in restful_resource-0.8.13 vs lib/restful_resource/base.rb in restful_resource-0.8.14
- old
+ new
@@ -38,9 +38,16 @@
response = http.put(url, data: data)
self.new(parse_json(response.body))
end
+ def self.post(data: {}, **params)
+ url = collection_url(params)
+
+ response = http.post(url, data: data)
+ self.new(parse_json(response.body))
+ end
+
def self.all
self.where
end
def self.action(action_name)