On Tue, Jun 2, 2009 at 10:33 PM, Flavio Mori <[email protected]> wrote:
>
> I want to send a response in a content type that is not listed in the
> request Accept header. When I try to do this in Rails a response of
> status code 406 Not Acceptable is sent. I would like to know how to do
> this.
>
> Ps: A example of a API that do this is the Sun Cloud API, where the
> errors are sent in a specific media type (http://kenai.com/projects/
> suncloudapis/pages/CommonBehaviors#Data_Models).

Add :status => 406 to your render call:

  render ..., :status => 406

Andrew Timberlake
http://ramblingsonrails.com

http://MyMvelope.com - The SIMPLE way to manage your savings

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to