| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|\
| |
| |
| | |
ActionController#translate supports symbols
|
| | |
|
| |
| |
| |
| | |
Made it similar to views helper.
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The methods `fresh_when` and `stale?` from ActionController::ConditionalGet
accept a single record as a short form for a hash. For instance
```ruby
def show
@article = Article.find(params[:id])
fresh_when(@article)
end
```
is just a short form for:
```ruby
def show
@article = Article.find(params[:id])
fresh_when(etag: @article, last_modified: @article.created_at)
end
```
This commit extends `fresh_when` and `stale?` to also accept a collection
of records, so that a short form similar to the one above can be used in
an `index` action. After this commit, the following code:
```ruby
def index
@article = Article.all
fresh_when(etag: @articles, last_modified: @articles.maximum(:created_at))
end
```
can be simply written as:
```ruby
def index
@article = Article.all
fresh_when(@articles)
end
```
|
| |
| |
| |
| |
| |
| | |
In match_head_routes, deleted the routes in which request.request_method was empty (matches all HTTP verbs) when responding to a HEAD request. This prevents catch-all routes (such as Racks) from intercepting the HEAD request.
Fixes #18698
|
|\ \
| | |
| | | |
Migrating xhr methods to keyword arguments syntax
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
in `ActionController::TestCase` and
`ActionDispatch::Integration`
Old syntax:
`xhr :get, :create, params: { id: 1 }`
New syntax example:
`get :create, params: { id: 1 }, xhr: true`
|
|/ / |
|
| | |
|
| |
| |
| |
| |
| |
| |
| |
| | |
Non-kwargs requests are deprecated now.
Guides are updated as well.
`post url, nil, nil, { a: 'b' }` doesn't make sense.
`post url, params: { y: x }, session: { a: 'b' }` would be an explicit way to do the same
|
| |
| |
| |
| |
| | |
Fixes an issue that would cause default_url_options to be lost when generating
URLs with fewer positional arguments than parameters in the route definition.
|
| | |
|
| | |
|
| |
| |
| |
| | |
Render arbitrary templates outside of controller actions
|
| | |
|
| | |
|
|\ \
| | |
| | |
| | | |
Default headers, removed in controller actions, will not be reapplied to the test response
|
|/ /
| |
| |
| | |
test response.
|
| | |
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
This functionality has been extracted to the responders gem.
|
| | |
|
| | |
|
| | |
|
| | |
|
| |
| |
| |
| | |
doesn't contain `#`
|
| | |
|
| | |
|
| | |
|
| | |
|
|\ \
| | |
| | |
| | |
| | |
| | |
| | | |
Ensure append_info_to_payload is called even if an exception is raised.
Conflicts:
actionpack/CHANGELOG.md
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
See:
* https://github.com/rails/rails/pull/14903
* https://github.com/roidrage/lograge/issues/37
Some code by mxrguspxrt from #14903.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
Commit 20fece1 introduced the `_status_code` method to fix calls to
`head :ok`. This method has been added on both ActionController::Metal
and ActionDispatch::Response.
As for the latter, this method is just equivalent to the `response_code`
one so commit aefec3c removed it from the `Reponse` object so call to
the `_status_code` method on an ActionController::Base instance would be
handled by the `Metal` class (which `Base` inherits from) but the status
code is not updated according to the response at this level.
The fix is to actually rely on `response_code` for ActionController::Base
instances but this method doesn't exist for bare Metal controllers so we
need to define it.
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
- The single space response was added due to a bug in safari
in https://github.com/rails/rails/commit/cb0f8fda9652c4d24d04693bdb82cecd3b067e5c
and
https://github.com/rails/rails/commit/807df4fcf021fc4d15972aa1c17ba7398d43ab0d.
- This was removed from the `render nothing: true` in
https://github.com/rails/rails/pull/14883.
- Removing it from response of :head also. As :head is more obvious
alternative to call `render nothing:
true`(http://guides.rubyonrails.org/layouts_and_rendering.html#using-head-to-build-header-only-responses),
removing it from head method also.
- Closes #18253.
|
| | |
| | |
| | |
| | | |
Fix form_for to work with objects that implement to_model
|
| | | |
|
| | | |
|
| | | |
|
|/ /
| |
| |
| |
| |
| |
| | |
There is no need to subtract one from the path_params size when there is
no format parameter because it is not present in the path_params array.
Fixes #17819.
|
| |
| |
| |
| |
| |
| |
| | |
We will support only Ruby >= 2.1.
But right now we don't accept pull requests with syntax changes to drop
support to Ruby 1.9.
|
|\ \
| | |
| | |
| | | |
Allow authentication header to not have to specify 'token=' key.
|
| | | |
|
| | |
| | |
| | |
| | |
| | |
| | | |
Fixes https://github.com/rails/rails/issues/16958
[Byron Bischoff & Melanie Gilman]
|
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | |
| | | |
In cases where this option is set to `true`, the option is redundant and can
be safely removed; otherwise, the corresponding `*_url` helper should be
used instead.
Fixes #17294.
See also #17363.
[Dan Olson, Godfrey Chan]
|
| | | |
|
|/ /
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The scanner in Journey fails to recognize routes that use literals
from the sub-delims section of RFC 3986.
This commit enhance the compatibility of Journey with the RFC by
adding support of authorized delimiters to the scanner.
Fix #17212
|