aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_dispatch/routing/mapper.rb
diff options
context:
space:
mode:
authorJosé Valim <jose.valim@gmail.com>2010-08-24 16:56:51 -0300
committerJosé Valim <jose.valim@gmail.com>2010-08-24 16:58:32 -0300
commit80e1f730a264a1875e2866cdff4b70b440f36159 (patch)
tree99579ba4dae624f909610fb3816973ee98e48daf /actionpack/lib/action_dispatch/routing/mapper.rb
parente197d6f34b72cd96ffc5c6680ed8d433f1b1c4db (diff)
downloadrails-80e1f730a264a1875e2866cdff4b70b440f36159.tar.gz
rails-80e1f730a264a1875e2866cdff4b70b440f36159.tar.bz2
rails-80e1f730a264a1875e2866cdff4b70b440f36159.zip
Allow format to be skipped. This is used internally by mount.
Diffstat (limited to 'actionpack/lib/action_dispatch/routing/mapper.rb')
-rw-r--r--actionpack/lib/action_dispatch/routing/mapper.rb7
1 files changed, 5 insertions, 2 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb
index f3cbba243c..9aa34e7ba5 100644
--- a/actionpack/lib/action_dispatch/routing/mapper.rb
+++ b/actionpack/lib/action_dispatch/routing/mapper.rb
@@ -87,7 +87,10 @@ module ActionDispatch
@options.reverse_merge!(:controller => /.+?/)
end
- if path.include?(":format")
+ if @options[:format] == false
+ @options.delete(:format)
+ path
+ elsif path.include?(":format")
path
else
"#{path}(.:format)"
@@ -244,7 +247,7 @@ module ActionDispatch
raise "A rack application must be specified" unless path
- match(path, options.merge(:to => app, :anchor => false))
+ match(path, options.merge(:to => app, :anchor => false, :format => false))
self
end