How does one customise the status code response when using the Grape gem? e.g.
post do
status = :accepted
@order = Order.find(params[:id])
end
This can be achieved for with error!({ error: 'Order not found'}, 404) but how does one do it for non errors?
Found the solution:
post do
status 203
@order = Order.find(params[:id])
end
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With