diff options
author | Carlhuda <carlhuda@engineyard.com> | 2010-03-08 12:24:49 -0800 |
---|---|---|
committer | Carlhuda <carlhuda@engineyard.com> | 2010-03-08 12:26:18 -0800 |
commit | f38e2e03351da463f84f6850fa10718ece98ff26 (patch) | |
tree | 811e4c92409f491646dcf1f969747d4e448bb0f3 /actionpack/lib/action_dispatch/routing/route.rb | |
parent | 7942e909608f24db0365943c5d9ad51cbb4d27b5 (diff) | |
download | rails-f38e2e03351da463f84f6850fa10718ece98ff26.tar.gz rails-f38e2e03351da463f84f6850fa10718ece98ff26.tar.bz2 rails-f38e2e03351da463f84f6850fa10718ece98ff26.zip |
Add support for mount RackApp, :at => "/sprockets" with a shorthand of mount Sprockets => "/sprockets".
This is different from the match syntax in that it cannot be used for controller/action and it does not
assume an anchor at the end of the match.
For instance, in the above example, if the client asked for "/sprockets/foo.js", the Sprockets app would
have a SCRIPT_NAME of "/sprockets" and PATH_INFO of "/foo.js".
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/route.rb')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/route.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/routing/route.rb b/actionpack/lib/action_dispatch/routing/route.rb index e6e44d3546..6f37eadd6b 100644 --- a/actionpack/lib/action_dispatch/routing/route.rb +++ b/actionpack/lib/action_dispatch/routing/route.rb @@ -4,7 +4,7 @@ module ActionDispatch attr_reader :app, :conditions, :defaults, :name attr_reader :path, :requirements - def initialize(app, conditions = {}, requirements = {}, defaults = {}, name = nil) + def initialize(app, conditions, requirements, defaults, name, anchor) @app = app @defaults = defaults @name = name @@ -17,7 +17,7 @@ module ActionDispatch if path = conditions[:path_info] @path = path - conditions[:path_info] = ::Rack::Mount::Strexp.compile(path, requirements, SEPARATORS) + conditions[:path_info] = ::Rack::Mount::Strexp.compile(path, requirements, SEPARATORS, anchor) end @conditions = conditions.inject({}) { |h, (k, v)| |