1. 29 7月, 2017 1 次提交
  2. 02 7月, 2017 1 次提交
  3. 01 7月, 2017 1 次提交
  4. 23 5月, 2017 1 次提交
  5. 06 2月, 2017 1 次提交
    • B
      Correct spelling · c8b5d828
      Benjamin Fleischer 提交于
      ```
      go get -u github.com/client9/misspell/cmd/misspell
      misspell  -w -error -source=text .
      ```
      c8b5d828
  6. 23 12月, 2016 1 次提交
  7. 16 8月, 2016 1 次提交
  8. 07 8月, 2016 4 次提交
  9. 25 2月, 2016 2 次提交
    • J
      Render default template if block doesn't render · 48f140cf
      Justin Coyne 提交于
      When a `respond_to` collector doesn't have a response, then a
      `:no_content` response should be rendered. This brings the default
      rendering behavior introduced by
      https://github.com/rails/rails/issues/19036 to controller methods
      employing `respond_to`
      48f140cf
    • G
      Lock down new `ImplicitRender` behavior for 5.0 RC · 73b1efc5
      Godfrey Chan 提交于
      1. Conceptually revert #20276
      
         The feature was implemented for the `responders` gem. In the end,
         they did not need that feature, and have found a better fix (see
         plataformatec/responders#131).
      
         `ImplicitRender` is the place where Rails specifies our default
         policies for the case where the user did not explicitly tell us
         what to render, essentially describing a set of heuristics. If
         the gem (or the user) knows exactly what they want, they could
         just perform the correct `render` to avoid falling through to
         here, as `responders` did (the user called `respond_with`).
      
         Reverting the patch allows us to avoid exploding the complexity
         and defining “the fallback for a fallback” policies.
      
      2. `respond_to` and templates are considered exhaustive enumerations
      
         If the user specified a list of formats/variants in a `respond_to`
         block, anything that is not explicitly included should result
         in an `UnknownFormat` error (which is then caught upstream to
         mean “406 Not Acceptable” by default). This is already how it
         works before this commit.
      
         Same goes for templates – if the user defined a set of templates
         (usually in the file system), that set is now considered exhaustive,
         which means that “missing” templates are considered `UnknownFormat`
         errors (406).
      
      3. To keep API endpoints simple, the implicit render behavior for
         actions with no templates defined at all (regardless of formats,
         locales, variants, etc) are defaulted to “204 No Content”. This
         is a strictly narrower version of the feature landed in #19036 and
         #19377.
      
      4. To avoid confusion when interacting in the browser, these actions
         will raise an `UnknownFormat` error for “interactive” requests
         instead. (The precise definition of “interactive” requests might
         change – the spirit here is to give helpful messages and avoid
         confusions.)
      
      Closes #20666, #23062, #23077, #23564
      
      [Godfrey Chan, Jon Moss, Kasper Timm Hansen, Mike Clark, Matthew Draper]
      73b1efc5
  10. 09 12月, 2015 1 次提交
  11. 07 10月, 2015 1 次提交
    • J
      Use `Mime[:foo]` instead of `Mime::Type[:FOO]` for back compat · 565094a8
      Jeremy Daer 提交于
      Rails 4.x and earlier didn't support `Mime::Type[:FOO]`, so libraries
      that support multiple Rails versions would've had to feature-detect
      whether to use `Mime::Type[:FOO]` or `Mime::FOO`.
      
      `Mime[:foo]` has been around for ages to look up registered MIME types
      by symbol / extension, though, so libraries and plugins can safely
      switch to that without breaking backward- or forward-compatibility.
      
      Note: `Mime::ALL` isn't a real MIME type and isn't registered for lookup
      by type or extension, so it's not available as `Mime[:all]`. We use it
      internally as a wildcard for `respond_to` negotiation. If you use this
      internal constant, continue to reference it with `Mime::ALL`.
      
      Ref. efc6dd55
      565094a8
  12. 18 7月, 2015 1 次提交
    • P
      Stop using deprecated `render :text` in test · 8cb8ce98
      Prem Sichanugrist 提交于
      This will silence deprecation warnings.
      
      Most of the test can be changed from `render :text` to render `:plain`
      or `render :body` right away. However, there are some tests that needed
      to be fixed by hand as they actually assert the default Content-Type
      returned from `render :body`.
      8cb8ce98
  13. 08 7月, 2015 1 次提交
    • A
      pass variants in rather than mutating the request. · 59a9068c
      Aaron Patterson 提交于
      Variants are typically set in the controller based on some attribute of
      the request that the browser sent.  We should make our tests more in
      line with reality by doing the same and not mutating the request object.
      59a9068c
  14. 21 6月, 2015 1 次提交
    • D
      Override default_render's behavior with a block · 6fda6c37
      Dave Copeland 提交于
      In 0de4a23d the behavior when there is a missing template was changed to
      not raise an error, but instead head :no_content.  This is a breaking
      change and some gems rely on this happening.
      
      To allow gems and other code to work around this, allow
      `default_render` to take a block which, if provided, will
      execute the contents of that block instead of doing the `head :no_content`.
      6fda6c37
  15. 06 4月, 2015 2 次提交
  16. 01 2月, 2015 1 次提交
  17. 29 1月, 2015 1 次提交
  18. 05 1月, 2015 1 次提交
  19. 30 10月, 2014 1 次提交
  20. 18 8月, 2014 4 次提交
  21. 10 7月, 2014 1 次提交
  22. 03 7月, 2014 1 次提交
  23. 20 5月, 2014 2 次提交
  24. 04 5月, 2014 1 次提交
  25. 15 4月, 2014 1 次提交
    • R
      Return null type format when format is not know · 4d21e496
      Rafael Mendonça França 提交于
      When requesting a controller with the following code with a unknown format:
      
          def my_action
            respond_to do |format|
              format.json { head :ok }
              format.any { render text: 'Default response' }
            end
          end
      
      we should render the default response instead of raising ActionController::UnknownFormat
      
      Fixes #14462
      
      Conflicts:
      	actionpack/CHANGELOG.md
      	actionpack/test/controller/mime/respond_with_test.rb
      
      Conflicts:
      	actionpack/CHANGELOG.md
      4d21e496
  26. 14 2月, 2014 1 次提交
  27. 13 2月, 2014 1 次提交
    • L
      Variant negotiation · f9b6b865
      Lukasz Strzalkowski 提交于
      Allow setting `request.variant` as an array - an order in which they will be
      rendered.
      
      For example:
      
        request.variant = [:tablet, :phone]
      
        respond_to do |format|
          format.html.none
          format.html.phone # this gets rendered
        end
      f9b6b865
  28. 27 12月, 2013 1 次提交
    • Ł
      Add any/all support for variants · a288cc1e
      Łukasz Strzałkowski 提交于
      Like `format.any`, you can do the same with variants.
      
      It works for both inline:
      
          respond_to do |format|
            format.html.any   { render text: "any"   }
            format.html.phone { render text: "phone" }
          end
      
      and block syntax:
      
          respond_to do |format|
            format.html do |variant|
              variant.any(:tablet, :phablet){ render text: "any" }
              variant.phone { render text: "phone" }
            end
          end
      a288cc1e
  29. 10 12月, 2013 1 次提交
    • Ł
      Inline variants syntax · edacdbfa
      Łukasz Strzałkowski 提交于
      In most cases, when setting variant specific code, you're not sharing any code
      within format.
      
      Inline syntax can vastly simplify defining variants in those situations:
      
        respond_to do |format|
          format.js { render "trash" }
          format.html do |variant|
            variant.phone { redirect_to progress_path }
            variant.none  { render "trash" }
          end
        end
      
      Becomes:
      
        respond_to do |format|
          format.js         { render "trash" }
          format.html.phone { redirect_to progress_path }
          format.html.none  { render "trash" }
        end
      edacdbfa
  30. 09 12月, 2013 2 次提交