<?xml version="1.0" encoding="UTF-8"?>
<commit>
  <added type="array"/>
  <modified type="array">
    <modified>
      <diff>@@ -112,19 +112,23 @@ module ActionController #:nodoc:
     protected
       # Exception handler called when the performance of an action raises an exception.
       def rescue_action(exception)
-        log_error(exception) if logger
-        erase_results if performed?
+        if handler_for_rescue(exception)
+          rescue_action_with_handler(exception)
+        else
+          log_error(exception) if logger
+          erase_results if performed?
 
-        # Let the exception alter the response if it wants.
-        # For example, MethodNotAllowed sets the Allow header.
-        if exception.respond_to?(:handle_response!)
-          exception.handle_response!(response)
-        end
+          # Let the exception alter the response if it wants.
+          # For example, MethodNotAllowed sets the Allow header.
+          if exception.respond_to?(:handle_response!)
+            exception.handle_response!(response)
+          end
 
-        if consider_all_requests_local || local_request?
-          rescue_action_locally(exception)
-        else
-          rescue_action_in_public(exception)
+          if consider_all_requests_local || local_request?
+            rescue_action_locally(exception)
+          else
+            rescue_action_in_public(exception)
+          end
         end
       end
 
@@ -200,7 +204,7 @@ module ActionController #:nodoc:
       def perform_action_with_rescue #:nodoc:
         perform_action_without_rescue
       rescue Exception =&gt; exception
-        rescue_action_with_handler(exception) || rescue_action(exception)
+        rescue_action(exception)
       end
 
       def rescues_path(template_name)</diff>
      <filename>actionpack/lib/action_controller/rescue.rb</filename>
    </modified>
    <modified>
      <diff>@@ -503,21 +503,24 @@ module ActionView
                     source = &quot;#{@controller.request.relative_url_root}#{source}&quot;
                   end
                 end
-                source = rewrite_asset_path(source)
 
-                if include_host
-                  host = compute_asset_host(source)
+                rewrite_asset_path(source)
+              end
+            end
 
-                  if has_request &amp;&amp; !host.blank? &amp;&amp; host !~ %r{^[-a-z]+://}
-                    host = &quot;#{@controller.request.protocol}#{host}&quot;
-                  end
+          source = ActionView::Base.computed_public_paths[cache_key]
 
-                  &quot;#{host}#{source}&quot;
-                else
-                  source
-                end
-              end
+          if include_host &amp;&amp; source !~ %r{^[-a-z]+://}
+            host = compute_asset_host(source)
+
+            if has_request &amp;&amp; !host.blank? &amp;&amp; host !~ %r{^[-a-z]+://}
+              host = &quot;#{@controller.request.protocol}#{host}&quot;
             end
+
+            &quot;#{host}#{source}&quot;
+          else
+            source
+          end
         end
 
         # Pick an asset host for this source. Returns +nil+ if no host is set,</diff>
      <filename>actionpack/lib/action_view/helpers/asset_tag_helper.rb</filename>
    </modified>
    <modified>
      <diff>@@ -62,6 +62,11 @@ class RescueController &lt; ActionController::Base
     render :text =&gt; exception.message
   end
 
+  # This is a Dispatcher exception and should be in ApplicationController.
+  rescue_from ActionController::RoutingError do
+    render :text =&gt; 'no way'
+  end
+
   def raises
     render :text =&gt; 'already rendered'
     raise &quot;don't panic!&quot;
@@ -378,6 +383,10 @@ class RescueTest &lt; Test::Unit::TestCase
     assert_equal &quot;RescueController::ResourceUnavailableToRescueAsString&quot;, @response.body
   end
 
+  def test_rescue_dispatcher_exceptions
+    RescueController.process_with_exception(@request, @response, ActionController::RoutingError.new(&quot;Route not found&quot;))
+    assert_equal &quot;no way&quot;, @response.body
+  end
 
   protected
     def with_all_requests_local(local = true)</diff>
      <filename>actionpack/test/controller/rescue_test.rb</filename>
    </modified>
  </modified>
  <removed type="array"/>
  <parents type="array">
    <parent>
      <id>58c435e07d4442c1ce3f5c48619b84e9f381f819</id>
    </parent>
    <parent>
      <id>72d022d1660d3f707bfe50cb20c976829ed4c949</id>
    </parent>
  </parents>
  <author>
    <name>Lourens Naude</name>
    <email>lourens@methodmissing.com</email>
  </author>
  <url>http://github.com/methodmissing/rails/commit/4c65556f6c4a0e7f2f341a127986c994a5d8b248</url>
  <id>4c65556f6c4a0e7f2f341a127986c994a5d8b248</id>
  <committed-date>2008-07-16T15:54:50-07:00</committed-date>
  <authored-date>2008-07-16T15:54:50-07:00</authored-date>
  <message>Merge branch 'master' of git://github.com/methodmissing/rails</message>
  <tree>cc44f7b6dbbc52a5ee6786aa2690a828a75b1ae9</tree>
  <committer>
    <name>Lourens Naude</name>
    <email>lourens@methodmissing.com</email>
  </committer>
</commit>
