Rails渲染content_type不起作用?

时间:2011-08-16 10:23:22

标签: ruby-on-rails xml

我的代码很简单:

  def xrds
       @services = {
                '0' => {
                        'Type' => [OpenID::OPENID_2_0_TYPE,OpenID::OPENID_1_0_TYPE],
                        'URI' => root_url
                        }
                }
        render :content_type => 'application/xrds+xml'
  end

但是Rails返回的内容类型是text / xml。任何想法如何解决这一问题?我的rails版本是3.0.6

1 个答案:

答案 0 :(得分:0)

尝试使用(渲染前):

response.headers['content-type'] = 'application/xrds+xml'

http://mail-archives.apache.org/mod_mbox/incubator-heraldry-commits/200610.mbox/%3C20061011221316.186F11A981D@eris.apache.org%3E