1. 07 12月, 2015 2 次提交
    • E
      Stop violating law of demeter in response cookie_jar · 8350925b
      eileencodes 提交于
      This adds a new method to request and response so we don't need to
      violate the law of demeter.
      
      We are changing `Request` and `Response` so that they always have a
      `cookie_jar`
      
      This is a continuation on work to combine integration and controller
      test code bases in Rails.
      8350925b
    • E
      Push `before_sending` to super class · 492b1344
      eileencodes 提交于
      We want to get rid of the `Live::Response` so we are consolidating methods
      from `Live::Response` and `Response` by merging them together.
      
      This adds an `#empty` method to the request so we don't need to
      hard-code the empty array each time we call an empty
      `ActionDispatch::Request`.
      
      The work here is a continuation on combining controller and integration
      test code bases into one.
      492b1344
  2. 06 12月, 2015 1 次提交
  3. 04 12月, 2015 1 次提交
  4. 28 11月, 2015 1 次提交
  5. 26 11月, 2015 1 次提交
  6. 22 11月, 2015 2 次提交
  7. 21 11月, 2015 1 次提交
  8. 20 11月, 2015 1 次提交
  9. 15 11月, 2015 2 次提交
  10. 12 11月, 2015 1 次提交
    • C
      Show middleware classes on /rails/info/properties · 6c75bcbb
      claudiob 提交于
      Closes #21230 by following the indication of @rafaelfranca:
      
      > I think the output change would be simpler.
      > What is really important to show is the class of the middleware, so we should change the output to show that.
      6c75bcbb
  11. 11 11月, 2015 1 次提交
  12. 04 11月, 2015 1 次提交
    • T
      Add text template for source code · 08689a2d
      Tijmen Brommet 提交于
      When a request is made with AJAX and an error occurs, Rails will render
      a text-template for the exception instead of the HTML error page
      (#11960).
      
      The `.text.erb` variant of the `_source` template is currently missing,
      causing HTML to be rendered in the response. This commit adds the text
      template.
      
      To keep the page scannable we only only show the first three source
      extracts.
      
      Related to #14745.
      
      Before:
      
      ```
      ~/testing-exceptions  ᐅ curl 'http://localhost:3000/' -H
      'X-Requested-With: XMLHttpRequest'
      RuntimeError in PostsController#index
      
          <div class="source " id="frame-source-0">
            <div class="info">
              Extracted source (around line <strong>#3</strong>):
            </div>
            <div class="data">
              <table cellpadding="0" cellspacing="0" class="lines">
                <tr>
      ```
      
      After:
      
      ```
      ~/testing-exceptions  ᐅ curl 'http://localhost:3000/' -H
      'X-Requested-With: XMLHttpRequest'
      RuntimeError in PostsController#index
      
      Extracted source (around line #3):
      
      *3     raise
      ```
      08689a2d
  13. 03 11月, 2015 2 次提交
  14. 02 11月, 2015 1 次提交
  15. 30 10月, 2015 5 次提交
  16. 28 10月, 2015 3 次提交
  17. 25 10月, 2015 1 次提交
  18. 23 10月, 2015 1 次提交
  19. 22 10月, 2015 2 次提交
  20. 21 10月, 2015 1 次提交
  21. 20 10月, 2015 1 次提交
  22. 19 10月, 2015 1 次提交
    • A
      Show helpful messages on invalid param. encodings · 3f81b375
      Agis Anastasopoulos 提交于
      Prior to this change, given a route:
      
          # config/routes.rb
          get ':a' => "foo#bar"
      
      If one pointed to http://example.com/%BE (param `a` has invalid encoding),
      a `BadRequest` would be raised with the following non-informative message:
      
          ActionController::BadRequest
      
      From now on the message displayed is:
      
          Invalid parameter encoding: hi => "\xBE"
      
      Fixes #21923.
      3f81b375
  23. 10 10月, 2015 2 次提交
    • R
      Allow multiple `root` routes in same scope level · 4db921a8
      Rafael Sales 提交于
      When an application has multiple root entries with different
      constraints, the current solution is to use `get '/'`. Example:
      
      **Currently I have to do:**
      ```ruby
      get '/', to: 'portfolio#show', constraints: ->(req) { Hostname.portfolio_site?(req.host) }
      get '/', to: 'blog#show',      constraints: ->(req) { Hostname.blog_site?(req.host) }
      root 'landing#show'
      ```
      
      **But I would like to do:**
      ```ruby
      root 'portfolio#show', constraints: ->(req) { Hostname.portfolio_site?(req.host) }
      root 'blog#show',      constraints: ->(req) { Hostname.blog_site?(req.host) }
      root 'landing#show'
      ```
      
      Other URL matchers such as `get`, `post`, etc, already allows this, so I
      think it's fair that `root` also allow it since it's just a shortcut for
      a `get` internally.
      4db921a8
    • R
      used predicate methods to avoid is_a? checks · ee47e34d
      Ronak Jangir 提交于
      ee47e34d
  24. 09 10月, 2015 1 次提交
  25. 08 10月, 2015 1 次提交
    • M
      Fix mounted engine named routes regression · bcfbd8ba
      Matthew Erhard 提交于
      When generating the url for a mounted engine through its proxy, the path should be the sum of three parts:
      
      1. Any `SCRIPT_NAME` request header or the value of `ActionDispatch::Routing::RouteSet#relative_url_root`.
      2. A prefix (the engine's mounted path).
      3. The path of the named route inside the engine.
      
      Since commit https://github.com/rails/rails/commit/44ff0313c121f528a68b3bd21d6c7a96f313e3d3, this has been broken. Step 2 has been changed to:
      
      2. A prefix (the value of `ActionDispatch::Routing::RouteSet#relative_url_root` + the engine's mounted path).
      
      The value of `ActionDispatch::Routing::RouteSet#relative_url_root` is taken into account in step 1 of the route generation and should be ignored when generating the mounted engine's prefix in step 2.
      
      This commit fixes the regression by having `ActionDispatch::Routing::RouteSet#url_for` check `options[:relative_url_root]` before falling back to `ActionDispatch::Routing::RouteSet#relative_url_root`. The prefix generating code then sets `options[:relative_url_root]` to an empty string. This empty string is used instead of `ActionDispatch::Routing::RouteSet#relative_url_root` and avoids the duplicate `relative_url_root` value in the final result.
      
      This resolves #20920 and resolves #21459
      bcfbd8ba
  26. 07 10月, 2015 3 次提交