I think you can just use `request.format` to get the format that will be rendered.