Permalink
Browse files

Allow format to be skipped. This is used internally by mount.

  • Loading branch information...
1 parent e197d6f commit 80e1f730a264a1875e2866cdff4b70b440f36159 @josevalim josevalim committed Aug 24, 2010
Showing with 6 additions and 3 deletions.
  1. +5 −2 actionpack/lib/action_dispatch/routing/mapper.rb
  2. +1 −1 actionpack/test/dispatch/routing_test.rb
@@ -87,7 +87,10 @@ def normalize_path(path)
@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 @@ def mount(app, options = nil)
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
@@ -218,7 +218,7 @@ def self.matches?(request)
get "thumbnail" => "avatars#thumbnail", :as => :thumbnail, :on => :member
end
resources :invoices do
- get "outstanding" => "invoices#outstanding", :as => :outstanding, :on => :collection
+ get "outstanding" => "invoices#outstanding", :on => :collection
get "overdue", :to => :overdue, :on => :collection
get "print" => "invoices#print", :as => :print, :on => :member
post "preview" => "invoices#preview", :as => :preview, :on => :new

0 comments on commit 80e1f73

Please sign in to comment.