diff options
author | Jamis Buck <jamis@37signals.com> | 2005-06-25 19:05:44 +0000 |
---|---|---|
committer | Jamis Buck <jamis@37signals.com> | 2005-06-25 19:05:44 +0000 |
commit | c6ea1d360cb81c6598170f3c8e368fe8efcb7a3c (patch) | |
tree | 4f06bad2a2c04201351f3e0393b4108683e8f4b5 /actionpack/lib/action_controller | |
parent | 1b07366c2fc12dcd38c1498e3239beb03103a09e (diff) | |
download | rails-c6ea1d360cb81c6598170f3c8e368fe8efcb7a3c.tar.gz rails-c6ea1d360cb81c6598170f3c8e368fe8efcb7a3c.tar.bz2 rails-c6ea1d360cb81c6598170f3c8e368fe8efcb7a3c.zip |
RoutingError should show 404.html when in public #1503 [Ulysses]
git-svn-id: http://svn-commit.rubyonrails.org/rails/trunk@1513 5ecf4fe2-1ee6-0310-87b1-e25e094e27de
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r-- | actionpack/lib/action_controller/routing.rb | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/actionpack/lib/action_controller/routing.rb b/actionpack/lib/action_controller/routing.rb index a402ddf1a3..3a1ef27234 100644 --- a/actionpack/lib/action_controller/routing.rb +++ b/actionpack/lib/action_controller/routing.rb @@ -29,9 +29,6 @@ module ActionController end end - class RoutingError < StandardError - end - class << self def test_condition(expression, condition) case condition @@ -413,7 +410,7 @@ module ActionController path.shift hash = recognize_path(path) - raise RoutingError, "No route matches path #{path.inspect}" unless hash + recognition_failed(request) unless hash && hash['controller'] controller = hash['controller'] hash['controller'] = controller.controller_path @@ -422,6 +419,10 @@ module ActionController end alias :recognize! :recognize + def recognition_failed(request) + raise ActionController::RoutingError, "Recognition failed for #{request.path.inspect}" + end + def write_recognition g = generator = CodeGeneration::RecognitionGenerator.new g.finish_statement = Proc.new {|hash_expr| "return #{hash_expr}"} |