From afa68eb1766d8893a1bb79bf989061f3d8f98049 Mon Sep 17 00:00:00 2001 From: Carl Lerche Date: Tue, 10 Jul 2012 16:16:00 -0700 Subject: Raise a helpful error message on #mount misuse --- actionpack/lib/action_dispatch/routing/mapper.rb | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'actionpack/lib') 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 -- cgit v1.2.3