rack-autocrud 0.1.10 → 0.1.11
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/rack/autocrud.rb +1 -1
- metadata +1 -1
data/lib/rack/autocrud.rb
CHANGED
@@ -100,7 +100,7 @@ module Rack
|
|
100
100
|
# Attempt to create the model object
|
101
101
|
obj = nil
|
102
102
|
begin
|
103
|
-
obj = model.
|
103
|
+
obj = model.create(JSON.parse(request.body.read))
|
104
104
|
halt [ 402, '{ "error": "Failed to save ' + endpoint + '" }' ] unless obj && obj.saved?
|
105
105
|
rescue JSON::ParserError
|
106
106
|
halt [ 400, { 'error' => 'Invalid JSON in request body.', 'details' => $! }.to_json ]
|