From c963f8e955ca5a2d1cc668ee5fa1f7e5f1fba689 Mon Sep 17 00:00:00 2001 From: Rick Olson Date: Sun, 13 Aug 2006 18:00:08 +0000 Subject: Tweak RoutingError message to show option diffs, not just missing named route significant keys. [Rick Olson] git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4756 5ecf4fe2-1ee6-0310-87b1-e25e094e27de --- actionpack/CHANGELOG | 2 ++ actionpack/lib/action_controller/routing.rb | 4 ++-- 2 files changed, 4 insertions(+), 2 deletions(-) (limited to 'actionpack') diff --git a/actionpack/CHANGELOG b/actionpack/CHANGELOG index f4827f65f5..2968661954 100644 --- a/actionpack/CHANGELOG +++ b/actionpack/CHANGELOG @@ -1,5 +1,7 @@ *SVN* +* Tweak RoutingError message to show option diffs, not just missing named route significant keys. [Rick Olson] + * Invoke method_missing directly on hidden actions. Closes #3030. [Nicholas Seckar] * Require Tempfile explicitly for TestUploadedFile due to changes in class auto loading. [Rick Olson] diff --git a/actionpack/lib/action_controller/routing.rb b/actionpack/lib/action_controller/routing.rb index 8dd5f37a8b..e4d8253714 100644 --- a/actionpack/lib/action_controller/routing.rb +++ b/actionpack/lib/action_controller/routing.rb @@ -1007,8 +1007,8 @@ module ActionController merged = recall.merge(options) if named_route - path = named_route.generate(options, merged, expire_on) - raise RoutingError, "#{named_route_name}_url failed to generate from #{options.inspect}, missing: #{(named_route.significant_keys - options.keys).inspect}" if path.nil? + path = named_route.generate(options, merged, expire_on) + raise RoutingError, "#{named_route_name}_url failed to generate from #{options.inspect}, expected: #{named_route.requirements.inspect}, diff: #{named_route.requirements.diff(options).inspect}" if path.nil? return path else merged[:action] ||= 'index' -- cgit v1.2.3