aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorDavid Heinemeier Hansson <david@loudthinking.com>2005-02-21 01:01:24 +0000
committerDavid Heinemeier Hansson <david@loudthinking.com>2005-02-21 01:01:24 +0000
commit48a44b77c138826e9ffaecd6fc63627d3f670086 (patch)
treef8228141bde6559a93c2ad3281c3db0519678d7f /actionpack/lib
parent824558816acb7b930624e3cbd4dae8e7413e12f4 (diff)
downloadrails-48a44b77c138826e9ffaecd6fc63627d3f670086.tar.gz
rails-48a44b77c138826e9ffaecd6fc63627d3f670086.tar.bz2
rails-48a44b77c138826e9ffaecd6fc63627d3f670086.zip
Fixed caching for root and Routing for getting back the current url
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@727 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_controller/caching.rb2
-rw-r--r--actionpack/lib/action_controller/routing.rb3
2 files changed, 4 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/caching.rb b/actionpack/lib/action_controller/caching.rb
index 173457ace0..c1b08dc927 100644
--- a/actionpack/lib/action_controller/caching.rb
+++ b/actionpack/lib/action_controller/caching.rb
@@ -90,7 +90,7 @@ module ActionController #:nodoc:
private
def page_cache_path(path)
- page_cache_directory + path + ".html"
+ page_cache_directory + (path.empty? ? "/index" : path) + ".html"
end
end
diff --git a/actionpack/lib/action_controller/routing.rb b/actionpack/lib/action_controller/routing.rb
index 18645ae4e0..a806b995c0 100644
--- a/actionpack/lib/action_controller/routing.rb
+++ b/actionpack/lib/action_controller/routing.rb
@@ -211,11 +211,14 @@ module ActionController
# Note that we *do* return immediately if
def generate(options, request)
raise RoutingError, "There are no routes defined!" if @routes.empty?
+
options = options.symbolize_keys
defaults = request.path_parameters.symbolize_keys
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|