From b04e1da114de77afcf5390a9ef11f5ce94e3b0d2 Mon Sep 17 00:00:00 2001 From: J Smith Date: Wed, 14 Apr 2010 01:26:12 -0400 Subject: [PATCH] Convert HashWithIndifferentAccess options to regular old Hashes with symbolized keys before trying to generate a route. --- actionpack/lib/action_dispatch/routing/url_for.rb | 1 + actionpack/lib/action_view/helpers/url_helper.rb | 1 + 2 files changed, 2 insertions(+), 0 deletions(-) diff --git a/actionpack/lib/action_dispatch/routing/url_for.rb b/actionpack/lib/action_dispatch/routing/url_for.rb index fb236dc..86370db 100644 --- a/actionpack/lib/action_dispatch/routing/url_for.rb +++ b/actionpack/lib/action_dispatch/routing/url_for.rb @@ -128,6 +128,7 @@ module ActionDispatch when String options when nil, Hash + options = options.to_hash.symbolize_keys if options.is_a?(ActiveSupport::HashWithIndifferentAccess) _router.url_for(url_options.merge(options || {})) else polymorphic_url(options) diff --git a/actionpack/lib/action_view/helpers/url_helper.rb b/actionpack/lib/action_view/helpers/url_helper.rb index 5925faf..576960a 100644 --- a/actionpack/lib/action_view/helpers/url_helper.rb +++ b/actionpack/lib/action_view/helpers/url_helper.rb @@ -102,6 +102,7 @@ module ActionView escape = true options when Hash + options = options.to_hash if options.is_a?(ActiveSupport::HashWithIndifferentAccess) options = { :only_path => options[:host].nil? }.update(options.symbolize_keys) escape = options.key?(:escape) ? options.delete(:escape) : false super -- 1.7.0.4