diff --git a/app/helpers/application_helper.rb b/app/helpers/application_helper.rb index e611a2cbd..92ec5f6f9 100644 --- a/app/helpers/application_helper.rb +++ b/app/helpers/application_helper.rb @@ -48,6 +48,7 @@ module ApplicationHelper buf << [ javascript_include_tag('jquery') ] end buf << [ javascript_include_tag('jquery_ujs') ] + buf << [ javascript_tag("jQuery.ajaxSetup({'cache': false});") ] buf.join("\n").html_safe end end diff --git a/spec/helpers/application_helper_spec.rb b/spec/helpers/application_helper_spec.rb index 7a34f9b89..19079a273 100644 --- a/spec/helpers/application_helper_spec.rb +++ b/spec/helpers/application_helper_spec.rb @@ -78,5 +78,9 @@ describe ApplicationHelper do it 'inclues jquery_ujs.js' do jquery_include_tag.should match(/jquery_ujs\.js/) end + + it "disables ajax caching" do + jquery_include_tag.should match(/jQuery\.ajaxSetup/) + end end end