aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/routing.rb
diff options
context:
space:
mode:
authorNicholas Seckar <nseckar@gmail.com>2006-02-04 23:09:26 +0000
committerNicholas Seckar <nseckar@gmail.com>2006-02-04 23:09:26 +0000
commitb381d8511d42e9b4f4f935e0e9f81a30d3993f6a (patch)
tree2d8d2251b749cf237c447bb4d15a240215faf9f9 /actionpack/lib/action_controller/routing.rb
parent28cee08fa440dfc9a9b73a4e9c16ca5d1db2fdbb (diff)
downloadrails-b381d8511d42e9b4f4f935e0e9f81a30d3993f6a.tar.gz
rails-b381d8511d42e9b4f4f935e0e9f81a30d3993f6a.tar.bz2
rails-b381d8511d42e9b4f4f935e0e9f81a30d3993f6a.zip
Fix Routing tests. Fix routing where failing to match a controller would prevent the rest of routes from being attempted.
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@3539 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller/routing.rb')
-rw-r--r--actionpack/lib/action_controller/routing.rb7
1 files changed, 3 insertions, 4 deletions
diff --git a/actionpack/lib/action_controller/routing.rb b/actionpack/lib/action_controller/routing.rb
index 2ad8534b15..a779b443ef 100644
--- a/actionpack/lib/action_controller/routing.rb
+++ b/actionpack/lib/action_controller/routing.rb
@@ -224,7 +224,7 @@ module ActionController
length = segments.length
index = start_at
mod_name = controller_name = segment = nil
-
+
while index < length
return nil unless /^[A-Za-z][A-Za-z\d_]*$/ =~ (segment = segments[index])
index += 1
@@ -247,7 +247,7 @@ module ActionController
(mod == Object || next_mod.name == "#{mod.name}::#{mod_name}") ? next_mod : nil
end
- raise RoutingError, "Cannot find controller: Dropped out at #{segments[start_at..index] * '/'}" unless mod
+ return nil unless mod
end
end
end
@@ -456,7 +456,6 @@ module ActionController
@generation_methods[controller.to_sym] = method_name
end
-
code = generation_code_for('routes', 'generate_default_path').to_s
eval(code, nil, 'generated_code/routing/generation.rb')
@@ -493,7 +492,7 @@ module ActionController
route.write_recognition(g)
end
end
-
+
eval g.to_s, nil, 'generated/routing/recognition.rb'
return g.to_s
end