lib/classy_resources.rb in giraffesoft-classy_resources-0.2.0 vs lib/classy_resources.rb in giraffesoft-classy_resources-0.2.1
- old
+ new
@@ -85,10 +85,13 @@
def define_collection_post(resource, format)
parent = options[:parent]
post collection_url_for(resource, format, parent) do
set_content_type(format)
object = create_object(resource, params[resource.to_s.singularize] || {}, parent)
- redirect object_url_for(resource, format, object)
+
+ response['location'] = object_url_for(resource, format, object)
+ response.status = 201
+ serialize(object, format)
end
end
def define_member_get(resource, format)
get object_route_url(resource, format) do