mirror of
https://github.com/github/rails.git
synced 2026-04-26 03:00:59 -04:00
Allow format to be skipped. This is used internally by mount.
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -218,7 +218,7 @@ class TestRoutingMapper < ActionDispatch::IntegrationTest
|
||||
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
|
||||
|
||||
Reference in New Issue
Block a user