- 12 3月, 2017 1 次提交
-
-
由 Hrvoje Šimić 提交于
[ci skip]
-
- 16 8月, 2016 1 次提交
-
-
由 Rafael Mendonça França 提交于
Style/SpaceBeforeBlockBraces Style/SpaceInsideBlockBraces Style/SpaceInsideHashLiteralBraces Fix all violations in the repository.
-
- 07 8月, 2016 1 次提交
-
-
由 Xavier Noria 提交于
The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
-
- 25 2月, 2016 1 次提交
-
-
由 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`
-
- 21 1月, 2016 2 次提交
- 25 10月, 2015 1 次提交
-
-
由 yuuji.yaginuma 提交于
-
- 07 10月, 2015 1 次提交
-
-
由 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
-
- 22 9月, 2015 2 次提交
-
-
由 Aaron Patterson 提交于
-
由 Aaron Patterson 提交于
We should be asking the mime type method for the mime objects rather than via const lookup
-
- 09 9月, 2015 1 次提交
-
-
由 Aaron Patterson 提交于
everything above metal really doesn't care about setting the content type, so lets rearrange these methods to be in metal.
-
- 27 8月, 2015 1 次提交
-
-
由 Aaron Patterson 提交于
Apparently the AbstractController (whatever "abstract" means) is expected to work without a request and response.
-
- 18 7月, 2015 1 次提交
-
-
由 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`.
-
- 25 3月, 2015 1 次提交
-
-
由 George Claghorn 提交于
Closes #18933.
-
- 05 1月, 2015 2 次提交
-
-
由 Carlos Antonio da Silva 提交于
This was used by the respond_to/respond_with implementation on this file, which is now extracted to the responders gem.
-
由 Carlos Antonio da Silva 提交于
This functionality has been extracted to the responders gem.
-
- 06 11月, 2014 1 次提交
-
-
由 Robert Evans 提交于
of respond_to. respond_with was moved into the responders gem and deprecated inside rails, so there is no need to mention it within rails itself.
-
- 19 10月, 2014 3 次提交
-
-
由 Rafael Mendonça França 提交于
Replace (slower) block.call with (faster) yield
-
由 Zachary Scott 提交于
This reverts commit 0ab075e7.
-
由 claudiob 提交于
Performance optimization: `yield` with an implicit `block` is faster than `block.call`. See http://youtu.be/fGFM_UrSp70?t=10m35s and the following benchmark: ```ruby require 'benchmark/ips' def fast yield end def slow(&block) block.call end Benchmark.ips do |x| x.report('fast') { fast{} } x.report('slow') { slow{} } end # => fast 154095 i/100ms # => slow 71454 i/100ms # => # => fast 7511067.8 (±5.0%) i/s - 37445085 in 4.999660s # => slow 1227576.9 (±6.8%) i/s - 6145044 in 5.028356s ```
-
- 18 10月, 2014 1 次提交
-
-
由 claudiob 提交于
Performance optimization: `yield` with an implicit `block` is faster than `block.call`. See http://youtu.be/fGFM_UrSp70?t=10m35s and the following benchmark: ```ruby require 'benchmark/ips' def fast yield end def slow(&block) block.call end Benchmark.ips do |x| x.report('fast') { fast{} } x.report('slow') { slow{} } end # => fast 154095 i/100ms # => slow 71454 i/100ms # => # => fast 7511067.8 (±5.0%) i/s - 37445085 in 4.999660s # => slow 1227576.9 (±6.8%) i/s - 6145044 in 5.028356s ```
-
- 18 8月, 2014 4 次提交
-
-
由 Godfrey Chan 提交于
-
由 Godfrey Chan 提交于
-
由 Godfrey Chan 提交于
-
由 José Valim 提交于
respond_with (and consequently the class-level respond_to) are being removed from Rails. Instead of moving it to a 3rd library, the functionality will be moved to responders gem (at github.com/plataformatec/responders) which already provides some responders extensions.
-
- 09 8月, 2014 1 次提交
-
-
由 Hendy Tanata 提交于
[skip ci]
-
- 17 6月, 2014 1 次提交
-
-
由 Aditya Kapoor 提交于
-
- 14 2月, 2014 1 次提交
-
-
由 David Heinemeier Hansson 提交于
No variant should also be picked up by variant.any if variant.none is not defined (just like any other variant)
-
- 13 2月, 2014 1 次提交
-
-
由 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
-
- 27 12月, 2013 1 次提交
-
-
由 Ł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
-
- 18 12月, 2013 1 次提交
-
-
由 Godfrey Chan 提交于
* Added release notes for secrets.yml and mentioned it in the highlights * Added release notes for Mailer previews and mentioned it in the highlights * Added release notes for Module#concerning * Removed mention for AV extraction from the highlights * Rearranged the major features to put highlighted features first * Various improvements and typo fixes [ci skip]
-
- 12 12月, 2013 1 次提交
-
-
由 Łukasz Strzałkowski 提交于
* Extend method documentation * Mention it in actionpack/CHANGELOG * Update release notes
-
- 10 12月, 2013 2 次提交
-
-
由 Ł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
-
由 Łukasz Strzałkowski 提交于
@responses hash needs to be initialized with mime types that we get from Collector#collect_mimes_from_class_level. Mime::Type class as key and nil as value. This need to happen before content negotiation. Before that, it was looping though mime types and executing mime-type-generated method inside collector (see AbstractController::Collector#generate_method_for_mime). That approach resulted in 2 unnecessary method calls for each mime type collected by Collector#collect_mimes_from_class_level. Now hash is initialized in place, without usage of Collector#custom method.
-
- 09 12月, 2013 3 次提交
-
-
由 David Heinemeier Hansson 提交于
This reverts commit 18616114, reversing changes made to cad9eb17.
-
由 Ł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 sitiations: 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
-
由 Łukasz Strzałkowski 提交于
@responses hash needs to be initialized with mime types that we get from Collector#collect_mimes_from_class_level. Mime::Type class as key and nil as value. This need to happen before content negotiation. Before that, it was looping though mime types and executing mime-type-generated method inside collector (see AbstractController::Collector#generate_method_for_mime). That approach resulted in 2 unnecessary method calls for each mime type collected by Collector#collect_mimes_from_class_level. Now hash is initialized in place, without usage of Collector#custom method.
-
- 08 12月, 2013 2 次提交
-
-
由 David Heinemeier Hansson 提交于
-
由 David Heinemeier Hansson 提交于
-
- 04 12月, 2013 1 次提交
-
-
由 Carlos Antonio da Silva 提交于
Avoid one-liner conditionals when they are too big. Avoid concatenating strings to build error messages. Improve messages a bit.
-