Permalink
Browse files

doc :anchor option for #match in routes

  • Loading branch information...
1 parent 21b12d8 commit 61781d84c11c8b5e37ad7cca5c40864759150a33 @cldwalker cldwalker committed Mar 15, 2011
Showing with 7 additions and 0 deletions.
  1. +7 −0 actionpack/lib/action_dispatch/routing/mapper.rb
@@ -364,6 +364,13 @@ def root(options = {})
# match 'path' => 'c#a', :defaults => { :format => 'jpg' }
#
# See <tt>Scoping#defaults</tt> for its scope equivalent.
+ #
+ # [:anchor]
+ # Boolean to anchor a #match pattern. Default is true. When set to
+ # false, the pattern matches any request prefixed with the given path.
+ #
+ # # Matches any request starting with 'path'
+ # match 'path' => 'c#a', :anchor => false
def match(path, options=nil)
mapping = Mapping.new(@set, @scope, path, options || {}).to_route
@set.add_route(*mapping)

0 comments on commit 61781d8

Please sign in to comment.