aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller/new_base/compatibility.rb
diff options
context:
space:
mode:
Diffstat (limited to 'actionpack/lib/action_controller/new_base/compatibility.rb')
-rw-r--r--actionpack/lib/action_controller/new_base/compatibility.rb38
1 files changed, 29 insertions, 9 deletions
diff --git a/actionpack/lib/action_controller/new_base/compatibility.rb b/actionpack/lib/action_controller/new_base/compatibility.rb
index 0a283887b6..4245ba982b 100644
--- a/actionpack/lib/action_controller/new_base/compatibility.rb
+++ b/actionpack/lib/action_controller/new_base/compatibility.rb
@@ -1,7 +1,10 @@
module ActionController
module Rails2Compatibility
extend ActiveSupport::DependencyModule
-
+
+ class ::ActionController::ActionControllerError < StandardError #:nodoc:
+ end
+
# Temporary hax
included do
::ActionController::UnknownAction = ::AbstractController::ActionNotFound
@@ -53,10 +56,23 @@ module ActionController
cattr_accessor :consider_all_requests_local
self.consider_all_requests_local = true
+
+ # Prepends all the URL-generating helpers from AssetHelper. This makes it possible to easily move javascripts, stylesheets,
+ # and images to a dedicated asset server away from the main web server. Example:
+ # ActionController::Base.asset_host = "http://assets.example.com"
+ cattr_accessor :asset_host
end
+ # For old tests
+ def initialize_template_class(*) end
+ def assign_shortcuts(*) end
+
+ # TODO: Remove this after we flip
+ def template
+ _action_view
+ end
+
module ClassMethods
- def protect_from_forgery() end
def consider_all_requests_local() end
def rescue_action(env)
raise env["action_dispatch.rescue.exception"]
@@ -67,7 +83,7 @@ module ActionController
@@cache_store = ActiveSupport::Cache.lookup_store(store_option)
end
end
-
+
def initialize(*)
super
@template = _action_view
@@ -80,7 +96,9 @@ module ActionController
options[:text] = nil if options[:nothing] == true
- super
+ body = super
+ body = [' '] if body.blank?
+ body
end
def _handle_method_missing
@@ -91,10 +109,12 @@ module ActionController
super || (respond_to?(:method_missing) && "_handle_method_missing")
end
- def _layout_for_name(name)
- name &&= name.sub(%r{^/?layouts/}, '')
- super
+ def _layout_prefix(name)
+ super unless name =~ /\blayouts/
+ end
+
+ def performed?
+ response_body
end
-
end
-end \ No newline at end of file
+end