rails/rails — Issue #4290: Allow custom http status to respond_with
Author: masterkain
Created: 2012-01-04 06:46:28+00:00
State: open

Specs revealed that `respond_with` ignores the `:status` parameter, it's my understanding that the status code derives from the passed object's state:

# 201, 422
respond_with @media, location: my_location_url

`:location` instead can be overridden; I have a use case for an internal API to return a particular http status code in presence of a specific validation failure, while maintaining goodies like acts_as_api, which is wrapping lightly respond_with:

respond_with @media, api_template: :v2_private_only_file_name, location: my_location_url, status: :conflict

The parameter status is being ignored, so I'd like to know if there's a consensus about letting the developer override it for specific calls.