aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack
diff options
context:
space:
mode:
authorSean Griffin <sean@seantheprogrammer.com>2014-11-29 15:31:12 -0700
committerSean Griffin <sean@seantheprogrammer.com>2014-11-29 15:31:12 -0700
commit5493d16d9e2fbc8efb0535c7a704a83d460a1beb (patch)
treea7cb945964ff8b477885414fdf6150ad73c1c577 /actionpack
parentf8c27e2a52847d8c293d1015b44e53160e7d684e (diff)
parentf413cbee8dd702e2cae550c04b16e6c98411aeab (diff)
downloadrails-5493d16d9e2fbc8efb0535c7a704a83d460a1beb.tar.gz
rails-5493d16d9e2fbc8efb0535c7a704a83d460a1beb.tar.bz2
rails-5493d16d9e2fbc8efb0535c7a704a83d460a1beb.zip
Merge pull request #17823 from byroot/fix-mount-rack-apps-with-as
Pure rack apps can be mounted with a name
Diffstat (limited to 'actionpack')
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb8
-rw-r--r--actionpack/test/dispatch/routing/inspector_test.rb2
2 files changed, 2 insertions, 8 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index a8be77f46d..5040aa82b2 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -580,13 +580,7 @@ module ActionDispatch
raise "A rack application must be specified" unless path
rails_app = rails_app? app
-
- if rails_app
- options[:as] ||= app.railtie_name
- else
- # non rails apps can't have an :as
- options[:as] = nil
- end
+ options[:as] ||= app.railtie_name if rails_app
target_as = name_for_action(options[:as], path)
options[:via] ||= :all
diff --git a/actionpack/test/dispatch/routing/inspector_test.rb b/actionpack/test/dispatch/routing/inspector_test.rb
index ff33dd5652..5910f364cc 100644
--- a/actionpack/test/dispatch/routing/inspector_test.rb
+++ b/actionpack/test/dispatch/routing/inspector_test.rb
@@ -235,7 +235,7 @@ module ActionDispatch
assert_equal [
"Prefix Verb URI Pattern Controller#Action",
- " /foo #{RackApp.name} {:constraint=>( my custom constraint )}"
+ " foo /foo #{RackApp.name} {:constraint=>( my custom constraint )}"
], output
end