mirror of
https://github.com/rails/rails.git
synced 2022-11-09 12:12:34 -05:00
release notes, extract notable changes from Action Pack CHANGELOG.
[ci skip]
This commit is contained in:
parent
a381add01f
commit
099082690d
2 changed files with 139 additions and 24 deletions
|
@ -34,7 +34,7 @@
|
|||
|
||||
*Jorge Bejar*
|
||||
|
||||
* Change the `protect_from_forgery` prepend default to `false`
|
||||
* Change the `protect_from_forgery` prepend default to `false`.
|
||||
|
||||
Per this comment
|
||||
https://github.com/rails/rails/pull/18334#issuecomment-69234050 we want
|
||||
|
@ -82,26 +82,29 @@
|
|||
|
||||
*Agis Anastasopoulos*
|
||||
|
||||
* Add the ability of returning arbitrary headers to ActionDispatch::Static
|
||||
* Add the ability of returning arbitrary headers to `ActionDispatch::Static`.
|
||||
|
||||
Now ActionDispatch::Static can accept HTTP headers so that developers
|
||||
will have control of returning arbitrary headers like
|
||||
'Access-Control-Allow-Origin' when a response is delivered. They can be
|
||||
configured with `#config`:
|
||||
|
||||
config.public_file_server.headers = {
|
||||
"Cache-Control" => "public, max-age=60",
|
||||
"Access-Control-Allow-Origin" => "http://rubyonrails.org"
|
||||
}
|
||||
Example:
|
||||
|
||||
config.public_file_server.headers = {
|
||||
"Cache-Control" => "public, max-age=60",
|
||||
"Access-Control-Allow-Origin" => "http://rubyonrails.org"
|
||||
}
|
||||
|
||||
*Yuki Nishijima*
|
||||
|
||||
* Allow multiple `root` routes in same scope level. Example:
|
||||
|
||||
```ruby
|
||||
root 'blog#show', constraints: ->(req) { Hostname.blog_site?(req.host) }
|
||||
root 'landing#show'
|
||||
```
|
||||
Example:
|
||||
|
||||
root 'blog#show', constraints: ->(req) { Hostname.blog_site?(req.host) }
|
||||
root 'landing#show'
|
||||
|
||||
*Rafael Sales*
|
||||
|
||||
* Fix regression in mounted engine named routes generation for app deployed to
|
||||
|
@ -112,12 +115,12 @@
|
|||
|
||||
*Matthew Erhard*
|
||||
|
||||
* ActionDispatch::Response#new no longer applies default headers. If you want
|
||||
* `ActionDispatch::Response#new` no longer applies default headers. If you want
|
||||
default headers applied to the response object, then call
|
||||
`ActionDispatch::Response.create`. This change only impacts people who are
|
||||
`ActionDispatch::Response.create`. This change only impacts people who are
|
||||
directly constructing an `ActionDispatch::Response` object.
|
||||
|
||||
* Accessing mime types via constants like `Mime::HTML` is deprecated. Please
|
||||
* Accessing mime types via constants like `Mime::HTML` is deprecated. Please
|
||||
change code like this:
|
||||
|
||||
Mime::HTML
|
||||
|
@ -170,7 +173,7 @@
|
|||
|
||||
*Jeremy Friesen*
|
||||
|
||||
* Using strings or symbols for middleware class names is deprecated. Convert
|
||||
* Using strings or symbols for middleware class names is deprecated. Convert
|
||||
things like this:
|
||||
|
||||
middleware.use "Foo::Bar"
|
||||
|
@ -179,10 +182,10 @@
|
|||
|
||||
middleware.use Foo::Bar
|
||||
|
||||
* ActionController::TestSession now accepts a default value as well as
|
||||
* `ActionController::TestSession` now accepts a default value as well as
|
||||
a block for generating a default value based off the key provided.
|
||||
|
||||
This fixes calls to session#fetch in ApplicationController instances that
|
||||
This fixes calls to `session#fetch` in `ApplicationController` instances that
|
||||
take more two arguments or a block from raising `ArgumentError: wrong
|
||||
number of arguments (2 for 1)` when performing controller tests.
|
||||
|
||||
|
@ -233,10 +236,10 @@
|
|||
*Grey Baker*
|
||||
|
||||
* Add support for API only apps.
|
||||
ActionController::API is added as a replacement of
|
||||
ActionController::Base for this kind of applications.
|
||||
`ActionController::API` is added as a replacement of
|
||||
`ActionController::Base` for this kind of applications.
|
||||
|
||||
*Santiago Pastorino & Jorge Bejar*
|
||||
*Santiago Pastorino*, *Jorge Bejar*
|
||||
|
||||
* Remove `assigns` and `assert_template`. Both methods have been extracted
|
||||
into a gem at https://github.com/rails/rails-controller-testing.
|
||||
|
@ -319,7 +322,7 @@
|
|||
|
||||
*Peter Schröder*
|
||||
|
||||
* Drop request class from RouteSet constructor.
|
||||
* Drop request class from `RouteSet` constructor.
|
||||
|
||||
If you would like to use a custom request class, please subclass and implement
|
||||
the `request_class` method.
|
||||
|
@ -348,7 +351,7 @@
|
|||
|
||||
*Jeremy Kemper*, *Yves Senn*
|
||||
|
||||
* Deprecate AbstractController#skip_action_callback in favor of individual skip_callback methods
|
||||
* Deprecate `AbstractController#skip_action_callback` in favor of individual skip_callback methods
|
||||
(which can be made to raise an error if no callback was removed).
|
||||
|
||||
*Iain Beeston*
|
||||
|
@ -554,9 +557,7 @@
|
|||
Fixes an issue where when an exception is raised in the request the additional
|
||||
payload data is not available.
|
||||
|
||||
See:
|
||||
* #14903
|
||||
* https://github.com/roidrage/lograge/issues/37
|
||||
See #14903.
|
||||
|
||||
*Dieter Komendera*, *Margus Pärt*
|
||||
|
||||
|
|
|
@ -131,14 +131,128 @@ Please refer to the [Changelog][action-pack] for detailed changes.
|
|||
* Removed `ActionDispatch::Request::Utils.deep_munge`.
|
||||
([commit](https://github.com/rails/rails/commit/52cf1a71b393486435fab4386a8663b146608996))
|
||||
|
||||
* Removed `ActionController::HideActions`.
|
||||
([Pull Request](https://github.com/rails/rails/pull/18371))
|
||||
|
||||
* Removed `respond_to` and `respond_with` placeholder methods, this functionality
|
||||
has been extracted to the
|
||||
[responders](https://github.com/plataformatec/responders) gem.
|
||||
([commit](https://github.com/rails/rails/commit/afd5e9a7ff0072e482b0b0e8e238d21b070b6280))
|
||||
|
||||
* Removed deprecated assertion files.
|
||||
([commit](https://github.com/rails/rails/commit/92e27d30d8112962ee068f7b14aa7b10daf0c976))
|
||||
|
||||
* Remove deprecated usage of string keys in URL helpers.
|
||||
([commit](https://github.com/rails/rails/commit/34e380764edede47f7ebe0c7671d6f9c9dc7e809))
|
||||
|
||||
* Removed deprecated `only_path` option on `*_path` helpers.
|
||||
([commit](https://github.com/rails/rails/commit/e4e1fd7ade47771067177254cb133564a3422b8a))
|
||||
|
||||
* Removed deprecated `NamedRouteCollection#helpers`.
|
||||
([commit](https://github.com/rails/rails/commit/2cc91c37bc2e32b7a04b2d782fb8f4a69a14503f))
|
||||
|
||||
* Removed deprecated support to define routes with `:to` option that doesn't contain `#`.
|
||||
([commit](https://github.com/rails/rails/commit/1f3b0a8609c00278b9a10076040ac9c90a9cc4a6))
|
||||
|
||||
* Removed deprecated `ActionDispatch::Response#to_ary`.
|
||||
([commit](https://github.com/rails/rails/commit/4b19d5b7bcdf4f11bd1e2e9ed2149a958e338c01))
|
||||
|
||||
* Removed deprecated `ActionDispatch::Request#deep_munge`.
|
||||
([commit](https://github.com/rails/rails/commit/7676659633057dacd97b8da66e0d9119809b343e))
|
||||
|
||||
* Removed deprecated
|
||||
`ActionDispatch::Http::Parameters#symbolized_path_parameters`.
|
||||
([commit](https://github.com/rails/rails/commit/7fe7973cd8bd119b724d72c5f617cf94c18edf9e))
|
||||
|
||||
* Removed deprecated option `use_route` in controller tests.
|
||||
([commit](https://github.com/rails/rails/commit/e4cfd353a47369dd32198b0e67b8cbb2f9a1c548))
|
||||
|
||||
* Removed `assigns` and `assert_template`. Both methods have been extracted
|
||||
into the
|
||||
[rails-controller-testing](https://github.com/rails/rails-controller-testing)
|
||||
gem.
|
||||
([Pull Request](https://github.com/rails/rails/pull/20138))
|
||||
|
||||
### Deprecations
|
||||
|
||||
* Deprecated all `*_filter` callbacks in favor of `*_action` callbacks.
|
||||
([Pull Request](https://github.com/rails/rails/pull/18410))
|
||||
|
||||
* Deprecated `*_via_redirect` integration test methods. Use `follow_redirect!`
|
||||
manually after the request call for the same behavior.
|
||||
([Pull Request](https://github.com/rails/rails/pull/18693))
|
||||
|
||||
* Deprecated `AbstractController#skip_action_callback` in favor of individual
|
||||
skip_callback methods.
|
||||
([Pull Request](https://github.com/rails/rails/pull/19060))
|
||||
|
||||
* Deprecated `:nothing` option for `render` method.
|
||||
([Pull Request](https://github.com/rails/rails/pull/20336))
|
||||
|
||||
* Deprecated passing first parameter as `Hash` and default status code for
|
||||
`head` method.
|
||||
([Pull Request](https://github.com/rails/rails/pull/20407))
|
||||
|
||||
* Deprecated using strings or symbols for middleware class names. Use class
|
||||
names instead.
|
||||
([commit](https://github.com/rails/rails/commit/83b767ce))
|
||||
|
||||
* Deprecated accessing mime types via constants (eg. `Mime::HTML`). Use the
|
||||
subscript operator with a symbol instead (eg. `Mime[:html]`).
|
||||
([Pull Request](https://github.com/rails/rails/pull/21869))
|
||||
|
||||
* Deprecated `redirect_to :back` in favor of `redirect_back`, which accepts a
|
||||
required `fallback_location` argument, thus eliminating the possibility of a
|
||||
`RedirectBackError`.
|
||||
([Pull Request](https://github.com/rails/rails/pull/22506))
|
||||
|
||||
### Notable changes
|
||||
|
||||
* Added `ActionController::Renderer` to render arbitrary templates
|
||||
outside controller actions.
|
||||
([Pull Request](https://github.com/rails/rails/pull/18546))
|
||||
|
||||
* Migrating to keyword arguments syntax in `ActionController::TestCase` and
|
||||
`ActionDispatch::Integration` HTTP request methods.
|
||||
([Pull Request](https://github.com/rails/rails/pull/18323))
|
||||
|
||||
* Added `http_cache_forever` to Action Controller, so we can cache a response
|
||||
that never gets expired.
|
||||
([Pull Request](https://github.com/rails/rails/pull/18394))
|
||||
|
||||
* Provide friendlier access to request variants.
|
||||
([Pull Request](https://github.com/rails/rails/pull/18939))
|
||||
|
||||
* For actions with no corresponding templates, render `head :no_content`
|
||||
instead of raising an error.
|
||||
([Pull Request](https://github.com/rails/rails/pull/19377))
|
||||
|
||||
* Added the ability to override default form builder for a controller.
|
||||
([Pull Request](https://github.com/rails/rails/pull/19736))
|
||||
|
||||
* Added support for API only apps.
|
||||
`ActionController::API` is added as a replacement of
|
||||
`ActionController::Base` for this kind of applications.
|
||||
([Pull Request](https://github.com/rails/rails/pull/19832))
|
||||
|
||||
* Make `ActionController::Parameters` no longer inherits from
|
||||
`HashWithIndifferentAccess`.
|
||||
([Pull Request](https://github.com/rails/rails/pull/20868))
|
||||
|
||||
* Make it easier to opt in to `config.force_ssl` and `config.ssl_options` by
|
||||
making them less dangerous to try and easier to disable.
|
||||
([Pull Request](https://github.com/rails/rails/pull/21520))
|
||||
|
||||
* Added the ability of returning arbitrary headers to `ActionDispatch::Static`.
|
||||
([Pull Request](https://github.com/rails/rails/pull/19135))
|
||||
|
||||
* Changed the `protect_from_forgery` prepend default to `false`.
|
||||
([commit](https://github.com/rails/rails/commit/39794037817703575c35a75f1961b01b83791191))
|
||||
|
||||
* `ActionController::TestCase` will be moved to it's own gem in Rails 5.1. Use
|
||||
`ActionDispatch::IntegrationTest` instead.
|
||||
([commit](https://github.com/rails/rails/commit/4414c5d1795e815b102571425974a8b1d46d932d))
|
||||
|
||||
Action View
|
||||
-------------
|
||||
|
||||
|
|
Loading…
Reference in a new issue