1. 03 5月, 2012 1 次提交
    • A
      Reset the request parameters after a constraints check · 56030506
      Andrew White 提交于
      A callable object passed as a constraint for a route may access the request
      parameters as part of its check. This causes the combined parameters hash
      to be cached in the environment hash. If the constraint fails then any subsequent
      access of the request parameters will be against that stale hash.
      
      To fix this we delete the cache after every call to `matches?`. This may have a
      negative performance impact if the contraint wraps a large number of routes as the
      parameters hash is built by merging GET, POST and path parameters.
      
      Fixes #2510.
      56030506
  2. 26 4月, 2012 2 次提交
  3. 25 4月, 2012 1 次提交
    • J
      Remove default match without specified method · 56cdc81c
      Jose and Yehuda 提交于
      In the current router DSL, using the +match+ DSL
      method will match all verbs for the path to the
      specified endpoint.
      
      In the vast majority of cases, people are
      currently using +match+ when they actually mean
      +get+. This introduces security implications.
      
      This commit disallows calling +match+ without
      an HTTP verb constraint by default. To explicitly
      match all verbs, this commit also adds a
      :via => :all option to +match+.
      
      Closes #5964
      56cdc81c
  4. 23 4月, 2012 1 次提交
  5. 03 4月, 2012 1 次提交
  6. 27 3月, 2012 2 次提交
  7. 26 3月, 2012 1 次提交
    • J
      Allow a defining custom member field on resources · 3e67e45d
      Jamie Macey 提交于
      By default, resources routes are created with :resource/:id. A model
      defining to_param can make prettier urls by using something more
      readable than an integer ID, but since the route picks it up as :id you
      wind up with awkward User.find_by_username(params[:id]) calls.
      
      By overriding the key to be used in @request.params you can be more
      obvious in your intent.
      3e67e45d
  8. 17 3月, 2012 2 次提交
  9. 04 3月, 2012 1 次提交
  10. 02 3月, 2012 1 次提交
  11. 25 2月, 2012 2 次提交
  12. 24 2月, 2012 1 次提交
  13. 23 2月, 2012 2 次提交
    • R
      Fix routes inspection order · a870d06c
      Rafael Mendonça França 提交于
      a870d06c
    • D
      Add config.default_method_for_update to support PATCH · 002713c6
      David Lee 提交于
      PATCH is the correct HTML verb to map to the #update action. The
      semantics for PATCH allows for partial updates, whereas PUT requires a
      complete replacement.
      
      Changes:
      * adds config.default_method_for_update you can set to :patch
      * optionally use PATCH instead of PUT in resource routes and forms
      * adds the #patch verb to routes to detect PATCH requests
      * adds #patch? to Request
      * changes documentation and comments to indicate support for PATCH
      
      This change maintains complete backwards compatibility by keeping :put
      as the default for config.default_method_for_update.
      002713c6
  14. 08 2月, 2012 1 次提交
  15. 06 2月, 2012 2 次提交
  16. 01 2月, 2012 1 次提交
  17. 24 1月, 2012 3 次提交
  18. 21 1月, 2012 1 次提交
  19. 29 12月, 2011 1 次提交
  20. 26 12月, 2011 1 次提交
    • P
      Correctly display rack apps with dynamic constraints in RoutesInspector · 28cd098d
      Piotr Sarnacki 提交于
      If you used dynamic constraint like that:
      
        scope :constraint => MyConstraint.new do
          mount RackApp => "/foo"
        end
      
      routes were not displayed correctly when using `rake routes`.
      This commit fixes it. If you want nice display of dynamic
      constraints in `rake routes` output, please just override
      to_s method in your constraint's class.
      28cd098d
  21. 24 12月, 2011 1 次提交
  22. 16 12月, 2011 1 次提交
  23. 30 11月, 2011 1 次提交
  24. 20 11月, 2011 1 次提交
  25. 19 11月, 2011 8 次提交