aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib
diff options
context:
space:
mode:
authorXavier Noria <fxn@hashref.com>2011-01-12 21:19:10 +0100
committerXavier Noria <fxn@hashref.com>2011-01-12 21:19:10 +0100
commit8b293e99ff2da0b5a60ff7bc5cde7bda9a2f715e (patch)
tree68afb497f317dab1652defe0f96bd20051b572cf /actionpack/lib
parent5bc98c9510a369a22b856cbe952d640f3825bb5c (diff)
parent31293ba9d33f5b5f62ee760a548b4f5438183f22 (diff)
downloadrails-8b293e99ff2da0b5a60ff7bc5cde7bda9a2f715e.tar.gz
rails-8b293e99ff2da0b5a60ff7bc5cde7bda9a2f715e.tar.bz2
rails-8b293e99ff2da0b5a60ff7bc5cde7bda9a2f715e.zip
Merge branch 'master' of github.com:rails/rails
Diffstat (limited to 'actionpack/lib')
-rw-r--r--actionpack/lib/action_controller/caching/fragments.rb2
-rw-r--r--actionpack/lib/action_dispatch/middleware/show_exceptions.rb4
-rw-r--r--actionpack/lib/action_dispatch/routing/route_set.rb2
-rw-r--r--actionpack/lib/action_view/test_case.rb4
4 files changed, 5 insertions, 7 deletions
diff --git a/actionpack/lib/action_controller/caching/fragments.rb b/actionpack/lib/action_controller/caching/fragments.rb
index 88f973e62d..0be04b70a1 100644
--- a/actionpack/lib/action_controller/caching/fragments.rb
+++ b/actionpack/lib/action_controller/caching/fragments.rb
@@ -59,7 +59,7 @@ module ActionController #:nodoc:
key = fragment_cache_key(key)
instrument_fragment_cache :write_fragment, key do
- content = content.html_safe.to_str if content.respond_to?(:html_safe)
+ content = content.to_str
cache_store.write(key, content, options)
end
content
diff --git a/actionpack/lib/action_dispatch/middleware/show_exceptions.rb b/actionpack/lib/action_dispatch/middleware/show_exceptions.rb
index 936fd548b9..dbe3206808 100644
--- a/actionpack/lib/action_dispatch/middleware/show_exceptions.rb
+++ b/actionpack/lib/action_dispatch/middleware/show_exceptions.rb
@@ -50,11 +50,11 @@ module ActionDispatch
# Only this middleware cares about RoutingError. So, let's just raise
# it here.
if headers['X-Cascade'] == 'pass'
- exception = ActionController::RoutingError.new("No route matches #{env['PATH_INFO'].inspect}")
+ raise ActionController::RoutingError, "No route matches #{env['PATH_INFO'].inspect}"
end
rescue Exception => exception
+ raise exception if env['action_dispatch.show_exceptions'] == false
end
- raise exception if env['action_dispatch.show_exceptions'] == false
exception ? render_exception(env, exception) : [status, headers, body]
end
diff --git a/actionpack/lib/action_dispatch/routing/route_set.rb b/actionpack/lib/action_dispatch/routing/route_set.rb
index 03bfe178e5..683fa19380 100644
--- a/actionpack/lib/action_dispatch/routing/route_set.rb
+++ b/actionpack/lib/action_dispatch/routing/route_set.rb
@@ -450,7 +450,7 @@ module ActionDispatch
end
def raise_routing_error
- raise ActionController::RoutingError.new("No route matches #{options.inspect}")
+ raise ActionController::RoutingError, "No route matches #{options.inspect}"
end
def different_controller?
diff --git a/actionpack/lib/action_view/test_case.rb b/actionpack/lib/action_view/test_case.rb
index 4026f7a40e..d4f16d4b36 100644
--- a/actionpack/lib/action_view/test_case.rb
+++ b/actionpack/lib/action_view/test_case.rb
@@ -156,10 +156,8 @@ module ActionView
# The instance of ActionView::Base that is used by +render+.
def view
@view ||= begin
- view = ActionView::Base.new(ActionController::Base.view_paths, {}, @controller)
+ view = @controller.view_context
view.singleton_class.send :include, _helpers
- view.singleton_class.send :include, @controller._routes.url_helpers
- view.singleton_class.send :delegate, :alert, :notice, :to => "request.flash"
view.extend(Locals)
view.locals = self.locals
view.output_buffer = self.output_buffer