diff options
author | Jon Leighton <j@jonathanleighton.com> | 2011-03-12 08:44:03 +0000 |
---|---|---|
committer | Jon Leighton <j@jonathanleighton.com> | 2011-03-12 08:44:03 +0000 |
commit | 17ea20426057aac43abcc0735534df31c577b918 (patch) | |
tree | fd6daf7d564a9ac7ca4b45964a761e50e40ba5be /actionpack/lib/action_dispatch/routing | |
parent | 02a43f9f4585d3c932e12b60ef23543f9c534a2e (diff) | |
parent | acd4bfb53764cfea0feaa367cfc8d00dbf9a87c3 (diff) | |
download | rails-17ea20426057aac43abcc0735534df31c577b918.tar.gz rails-17ea20426057aac43abcc0735534df31c577b918.tar.bz2 rails-17ea20426057aac43abcc0735534df31c577b918.zip |
Merge branch 'master' into nested_has_many_through
Diffstat (limited to 'actionpack/lib/action_dispatch/routing')
-rw-r--r-- | actionpack/lib/action_dispatch/routing/mapper.rb | 21 |
1 files changed, 6 insertions, 15 deletions
diff --git a/actionpack/lib/action_dispatch/routing/mapper.rb b/actionpack/lib/action_dispatch/routing/mapper.rb index 1733c8032a..f67708722b 100644 --- a/actionpack/lib/action_dispatch/routing/mapper.rb +++ b/actionpack/lib/action_dispatch/routing/mapper.rb @@ -107,7 +107,7 @@ module ActionDispatch if @options[:format] == false @options.delete(:format) path - elsif path.include?(":format") + elsif path.include?(":format") || path.end_with?('/') path else "#{path}(.:format)" @@ -243,10 +243,6 @@ module ActionDispatch end module Base - def initialize(set) #:nodoc: - @set = set - end - # You can specify what Rails should route "/" to with the root method: # # root :to => 'pages#main' @@ -558,11 +554,6 @@ module ActionDispatch # PUT /admin/posts/1 # DELETE /admin/posts/1 module Scoping - def initialize(*args) #:nodoc: - @scope = {} - super - end - # Scopes a set of routes to the given default options. # # Take the following route definition as an example: @@ -956,11 +947,6 @@ module ActionDispatch alias :nested_scope :path end - def initialize(*args) #:nodoc: - super - @scope[:path_names] = @set.resources_path_names - end - def resources_path_names(options) @scope[:path_names].merge!(options) end @@ -1473,6 +1459,11 @@ module ActionDispatch end end + def initialize(set) #:nodoc: + @set = set + @scope = { :path_names => @set.resources_path_names } + end + include Base include HttpHelpers include Redirection |