I would like to restrict requests to all API controllers to being redirected to the JSON path. I would like to use a redirect since also the URL should change according to the r
Second option, using routes format. If a user explicitly requests a XML format, he should not receive a JSON response. He should get a message saying that this URL doesn't answer to XML format, or 404.
By the way, it would be rather easy to respond to all which is what you should do in my opinion.
class FooController
respond_to :xml, :json
def show
@bar = Bar.find(params[:id])
respond_with(@bar)
end
end