aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/caching.rb
diff options
context:
space:
mode:
authorMarcel Molina <marcel@vernix.org>2006-10-12 23:29:04 +0000
committerMarcel Molina <marcel@vernix.org>2006-10-12 23:29:04 +0000
commit065908a4c59f949c49abb97a9483ef16d02ec329 (patch)
tree45517cfa078f558ecb2abc819b02d5a60e74cf20 /actionpack/lib/action_controller/caching.rb
parent41c362352433f265a95c00d8e7b5c1f1299e9011 (diff)
downloadrails-065908a4c59f949c49abb97a9483ef16d02ec329.tar.gz
rails-065908a4c59f949c49abb97a9483ef16d02ec329.tar.bz2
rails-065908a4c59f949c49abb97a9483ef16d02ec329.zip
Make page caching respect the format of the resource that is being requested even if the current route is the default route so that, e.g. posts.rss is not transformed by url_for to '/' and subsequently cached as '/index.html' when it should be cached as '/posts.rss'.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@5289 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller/caching.rb')
-rw-r--r--actionpack/lib/action_controller/caching.rb6
1 files changed, 3 insertions, 3 deletions
diff --git a/actionpack/lib/action_controller/caching.rb b/actionpack/lib/action_controller/caching.rb
index 926535da03..a91a2198a6 100644
--- a/actionpack/lib/action_controller/caching.rb
+++ b/actionpack/lib/action_controller/caching.rb
@@ -118,10 +118,10 @@ module ActionController #:nodoc:
return unless perform_caching
if options[:action].is_a?(Array)
options[:action].dup.each do |action|
- self.class.expire_page(url_for(options.merge({ :only_path => true, :skip_relative_url_root => true, :action => action })))
+ self.class.expire_page(url_for(options.merge(:only_path => true, :skip_relative_url_root => true, :action => action)))
end
else
- self.class.expire_page(url_for(options.merge({ :only_path => true, :skip_relative_url_root => true })))
+ self.class.expire_page(url_for(options.merge(:only_path => true, :skip_relative_url_root => true)))
end
end
@@ -130,7 +130,7 @@ module ActionController #:nodoc:
# cache_page "I'm the cached content", :controller => "lists", :action => "show"
def cache_page(content = nil, options = {})
return unless perform_caching && caching_allowed
- self.class.cache_page(content || response.body, url_for(options.merge({ :only_path => true, :skip_relative_url_root => true })))
+ self.class.cache_page(content || response.body, url_for(options.merge(:only_path => true, :skip_relative_url_root => true, :format => params[:format])))
end
private