Rails Rails Content Negotiation 的奇怪问题

ShiningRay · June 10, 2012 · Last by ShiningRay replied at June 10, 2012 · 2601 hits

有没有这种可能性,即使在 url 中已经指定了 params[:format],如

/articles/1/comments.json

但是依然返回的 HTML 结果

目前开发中发现有时候这个路径缓存的会是 html 结果,导致 ajax 请求失败,所以想请教一下高手

环境是 Rails 2.3.14,respond_to 块中有 html 和 json

把 format 加到 cache key 里面

#1 楼 @hooopo /articles/1/comments.json 我直接用的这个,里面不是已经有 format 了么

You need to Sign in before reply, if you don't have an account, please Sign up first.