Skip to content

Commit

Permalink
Tweak RoutingError message to show option diffs, not just missing nam…
Browse files Browse the repository at this point in the history
…ed route significant keys. [Rick Olson]

git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@4756 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
  • Loading branch information
technoweenie committed Aug 13, 2006
1 parent 84bacf9 commit c963f8e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions actionpack/CHANGELOG
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
4 changes: 2 additions & 2 deletions actionpack/lib/action_controller/routing.rb
Original file line number Diff line number Diff line change
Expand Up @@ -1007,8 +1007,8 @@ def generate(options, recall = {}, method=:generate)
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'
Expand Down

0 comments on commit c963f8e

Please sign in to comment.