aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_controller/caching.rb10
-rw-r--r--actionpack/lib/action_controller/routing.rb3
2 files changed, 8 insertions, 5 deletions
diff --git a/actionpack/lib/action_controller/caching.rb b/actionpack/lib/action_controller/caching.rb
index c1b08dc927..c51e0f4d70 100644
--- a/actionpack/lib/action_controller/caching.rb
+++ b/actionpack/lib/action_controller/caching.rb
@@ -67,7 +67,7 @@ module ActionController #:nodoc:
def expire_page(path)
return unless perform_caching
File.delete(page_cache_path(path)) if File.exists?(page_cache_path(path))
- logger.info "Expired page: #{path}" unless logger.nil?
+ logger.info "Expired page: #{page_cache_file(path)}" unless logger.nil?
end
# Manually cache the +content+ in the key determined by +path+. Example:
@@ -76,7 +76,7 @@ module ActionController #:nodoc:
return unless perform_caching
FileUtils.makedirs(File.dirname(page_cache_path(path)))
File.open(page_cache_path(path), "w+") { |f| f.write(content) }
- logger.info "Cached page: #{path}" unless logger.nil?
+ logger.info "Cached page: #{page_cache_file(path)}" unless logger.nil?
end
# Caches the +actions+ using the page-caching approach that'll store the cache in a path within the page_cache_directory that
@@ -89,8 +89,12 @@ module ActionController #:nodoc:
end
private
+ def page_cache_file(path)
+ (path.empty? ? "/index" : path) + ".html"
+ end
+
def page_cache_path(path)
- page_cache_directory + (path.empty? ? "/index" : path) + ".html"
+ page_cache_directory + page_cache_file(path)
end
end
diff --git a/actionpack/lib/action_controller/routing.rb b/actionpack/lib/action_controller/routing.rb
index a806b995c0..f97956d040 100644
--- a/actionpack/lib/action_controller/routing.rb
+++ b/actionpack/lib/action_controller/routing.rb
@@ -214,11 +214,10 @@ module ActionController
options = options.symbolize_keys
defaults = request.path_parameters.symbolize_keys
+ options = defaults if options.empty? # Get back the current url if no options was passed
expand_controller_path!(options, defaults)
defaults.delete_if {|k, v| options.key?(k) && options[k].nil?} # Remove defaults that have been manually cleared using :name => nil
- options = defaults if options.empty? # Get back the current url if no options was passed
-
failures = []
selected = nil
self.each do |route|