Specs revealed that respond_with ignores the :status parameter; it's my understanding that the status code derives from the passed object's state:
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 respond_with to render a custom representation of the object:
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.
Can you write a test case that shows the problem? It looks like Rails has tests for overriding the status:
Some failing code would help! Thanks.
What is happening here is that the default behavior for html in a successful post is to redirect. So there is no way Rails can redirect and set the status code to conflict. You need to override the html branch of your code or whatever navigational path you are using.