aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing
diff options
context:
space:
mode:
authorCarl Lerche <me@carllerche.com>2012-07-10 16:16:00 -0700
committerCarl Lerche <me@carllerche.com>2012-07-10 16:17:02 -0700
commitafa68eb1766d8893a1bb79bf989061f3d8f98049 (patch)
tree922b93a69e426c53918310070e98f25f2aff7d61 /actionpack/lib/action_dispatch/routing
parent89dc4813520c38e4ec62d3ab9b8fda8254987327 (diff)
downloadrails-afa68eb1766d8893a1bb79bf989061f3d8f98049.tar.gz
rails-afa68eb1766d8893a1bb79bf989061f3d8f98049.tar.bz2
rails-afa68eb1766d8893a1bb79bf989061f3d8f98049.zip
Raise a helpful error message on #mount misuse
Diffstat (limited to 'actionpack/lib/action_dispatch/routing')
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb4
1 files changed, 4 insertions, 0 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index 53a4afecb3..a49b12621e 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -430,6 +430,10 @@ module ActionDispatch
if options
path = options.delete(:at)
else
+ unless Hash === app
+ raise ArgumentError, "must be called with mount point"
+ end
+
options = app
app, path = options.find { |k, v| k.respond_to?(:call) }
options.delete(app) if app