■
class PostsController < ApplicationController respond_to :html, :json def index @posts = Post.all respond_with @posts end end
$.ajax('/posts', { dataType: 'json', contentType: 'application/json' })
みたいな感じのがあったとして、
/posts
に遷移- どっか他のページに遷移
$.ajax('/posts', { ... })
実行- /postsに戻る
で、キャッシュされたjsonが「Content-Type?ウェ?」みたいな感じで描画された。。。(Chrome)
とりあえず何が正しいのか調べてるけど、とりあえず cache: false
することで現実の問題から逃げました。