aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_controller
diff options
context:
space:
mode:
authorPiotr Sarnacki <drogus@gmail.com>2012-08-11 15:14:42 +0200
committerPiotr Sarnacki <drogus@gmail.com>2012-08-28 10:51:03 +0200
commit7185e35971f4a18f48a7d67e5c86c2fcf87bdb66 (patch)
treeb4a66a624ce1faa430afd51ad21a988d4d16fe63 /actionpack/lib/action_controller
parent1ec1eb2ff2ad5de70db7a632b93641a06a623a42 (diff)
downloadrails-7185e35971f4a18f48a7d67e5c86c2fcf87bdb66.tar.gz
rails-7185e35971f4a18f48a7d67e5c86c2fcf87bdb66.tar.bz2
rails-7185e35971f4a18f48a7d67e5c86c2fcf87bdb66.zip
Remove dependency on actionpack in ActionView::AssetPaths
Since Action View should not depend on actionpack, it's best to delegate invalid_asset_host! to controller and just rely on such simple contract instead of raising ActionController::RoutingError directly.
Diffstat (limited to 'actionpack/lib/action_controller')
-rw-r--r--actionpack/lib/action_controller/base.rb2
-rw-r--r--actionpack/lib/action_controller/metal/asset_paths.rb15
2 files changed, 16 insertions, 1 deletions
diff --git a/actionpack/lib/action_controller/base.rb b/actionpack/lib/action_controller/base.rb
index f829f5e8a2..0d79e046a1 100644
--- a/actionpack/lib/action_controller/base.rb
+++ b/actionpack/lib/action_controller/base.rb
@@ -183,8 +183,8 @@ module ActionController
MODULES = [
AbstractController::Layouts,
AbstractController::Translation,
- AbstractController::AssetPaths,
+ AssetPaths,
Helpers,
HideActions,
UrlFor,
diff --git a/actionpack/lib/action_controller/metal/asset_paths.rb b/actionpack/lib/action_controller/metal/asset_paths.rb
new file mode 100644
index 0000000000..5165814dfe
--- /dev/null
+++ b/actionpack/lib/action_controller/metal/asset_paths.rb
@@ -0,0 +1,15 @@
+require 'action_controller/metal/exceptions'
+
+module ActionController
+ module AssetPaths
+ extend ActiveSupport::Concern
+
+ included do
+ include AbstractController::AssetPaths
+ end
+
+ def invalid_asset_host!(help_message)
+ raise ActionController::RoutingError, "This asset host cannot be computed without a request in scope. #{help_message}"
+ end
+ end
+end