| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
|
|
| |
- Add missing dots at the end of sentences.
- Wrap RecordTagHelper into `.
- `RecordTagHelper` => `ActionView::Helpers::RecordTagHelper`.
[ci skip]
|
|
|
|
|
|
|
| |
* Since #18411, we started to inform about extracted gem (record_tag_helper)
to developers who use `ActionView::Helpers::RecordTagHelper` 's methods.
* Currently, it seems no problem that we don't have to support no longer.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
ActionView::Template instances compile their source to methods on the
ActionView::CompiledTemplates module. To prevent leaks in development
mode, where templates can frequently change, a finalizer is added that
undefines these methods[1] when the templates are garbage-collected.
This is undesirable in the test environment, however, as templates don't
change during the life of the test. Moreover, the cost of undefining a
method is proportional to the number of descendants a class or module
has, since the method cache must be cleared for all descendant classes.
As ActionView::CompiledTemplates is mixed into every
ActionView::TestCase (or in RSpec suites, every view spec example
group), it can end up with a very large number of descendants, and
undefining its methods can become very expensive.
In large test suites, this results in a long delay at the end of the
test suite as all template finalizers are run, only for the process to
then exit.
To avoid this unnecessary cost, this change adds a config option,
`action_view.finalize_compiled_template_methods`, defaulting to true,
and sets it to false in the test environment only.
[1] https://github.com/rails/rails/blob/09b2348f7fc8d4e7191e70e06608c5909067e2aa/actionview/lib/action_view/template.rb#L118-L126
|
| |
|
|
|
|
|
|
| |
We only add the header when releasing to avoid some conflicts.
[ci skip]
|
|
|
|
|
|
|
|
| |
- Add missing dots.
- Remove reference to itself on GitHub.
Usually, we add references to fixed issues only in a changelog.
Follow up #32223
|
| |
|
| |
|
|
|
|
|
|
| |
With the disabling of TLS 1.0 by most major websites, continuing to run
IE8 or lower becomes increasingly difficult so default to not enforcing
UTF-8 encoding as it's not relevant to other browsers.
|
|
|
|
|
|
|
|
|
|
| |
module_name/class_name
Currently submit_tag value translation does not support i18n key style
locale key.
It confuses me a bit because many other components support i18n key
style locale key.
I added i18n key style locale key support to submit tag.
|
|
|
|
|
|
| |
Skipping over 2.4.0 to sidestep the `"symbol_from_string".to_sym.dup` bug.
References #32028
|
|
|
|
| |
:tada::tada::tada:
|
|
|
|
|
|
| |
Replaced the uses of `group.send(...)` in `option_groups_from_collection_for_select`
by calls to `value_for_collection(group, ...)`, allowing the use of
procs, lambdas and other callable objects as parameters.
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
This helper creates a link tag with preload keyword that allows to
browser to initiate early fetch of resources. Additionally this send
Early Hints if supported.
See https://github.com/rails/rails/pull/30744/commits/59a02fb7bcbe68f26e1e7fdcec45c00c66e4a065
for more details about Early Hints.
Preload spec: https://w3c.github.io/preload/
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
| |
When `form_with` was introduced we disabled the automatic
generation of ids that was enabled in `form_for`. This usually
is not an good idea since labels don't work when the input
doesn't have an id and it made harder to test with Capybara.
You can still disable the automatic generation of ids setting
`config.action_view.form_with_generates_ids` to `false.`
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
### Summary
The [`:field_error_proc`](https://github.com/rails/rails/blob/master/actionview/lib/action_view/base.rb#L145) is responsible for decorating input tags that refer to attributes with errors. This default build-in rails feature wrap invalid form elements with additional markup: `<div class="field_with_errors">[…]</div>`.
* Fix for `field_error_proc` wraps form select `optgroup`
* Fix for `field_error_proc` wraps form select divider `option`
* Add tests for uncovered elements with errors
[Fixes #31088]
#### Test coverage
* `test_select_grouped_options_with_errors`
* `test_time_zone_select_with_priority_zones_and_errors`
#### Extend test coverage
* `test_collection_select_with_errors`
* `test_label_with_errors`
* `test_check_box_with_errors`
* `test_check_boxes_with_errors`
* `test_radio_button_with_errors`
* `test_radio_buttons_with_errors`
* `test_collection_check_boxes_with_errors`
* `test_collection_radio_buttons_with_errors`
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
- Auto-generating content from the filename of an image is not suitable
alternative text; alt text that isn't fully considered can be
distracting and fatiguing for screen readers users (blind, low vision,
dyslexic people).
- Setting a filename fallback short circuits screen reader default
behavior and configuration for blank descriptions.
- Setting poor defaults also creates false negatives for accessibility
linting and testing software, that makes it harder to improve
application accessibility.
***
- After this change, if authors leave images without alt text, screen
readers will fallback to default behavior for missing alt text.
- Also with this change, Automated linting and testing tools will
correctly generate warnings.
[Fixes #30096]
|
|\
| |
| |
| | |
Add srcset option to image_tag helper
|
|/ |
|
|
|
|
| |
[ci skip]
|
|
|
|
|
|
| |
fix
fix
|
|
|
|
|
| |
This makes sure that the labels are linked up with the fields.
Fixes #29014
|
|
|
|
|
| |
This allows auto_discovery_link_tag to support the JSON Feed standard.
See https://jsonfeed.org/version/1 for more information.
|
|
|
|
|
|
| |
* Remove trailing spaces.
* Add backticks around method and command.
* Fix indentation.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
* Internally all input is converted to time so that it can be treated
uniformly.
Remove now-unneeded condition
* Now that all input is treated is converted to time, we no longer need
to type check it.
Rename variables to clarify their purpose
Extract private method to normalize distance_of_time args to time
Update actionview changelog
|
| |
|
|\
| |
| | |
Add CHANGELOG for #26226 [ci skip]
|
| | |
|
|/
|
|
| |
[ci skip]
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Erubi offers the following advantages for Rails:
* Works with ruby's --enable-frozen-string-literal option
* Has 88% smaller memory footprint
* Does no freedom patching (Erubis adds a method to Kernel)
* Has simpler internals (1 file, <150 lines of code)
* Has an open development model (Erubis doesn't have a
public source control repository or bug tracker)
* Is not dead (Erubis hasn't been updated since 2011)
Erubi is a simplified fork of Erubis that contains just the
parts that are generally needed (which includes the parts
that Rails uses). The only intentional difference in
behavior is that it does not include support for <%=== tags
for debug output. That could be added to the ActionView ERB
handler if it is desired.
The Erubis template handler remains in a deprecated state
so that code that accesses it directly does not break. It
can be removed after Rails 5.1.
|
|
|
|
|
|
|
|
|
| |
In #26672 we blocked use of Ruby keywords as identifiers for view
locals but inadvertently broke the use of instance variable names
as identifiers. Whilst not explicitly documented this behavior has
been around for a long time and there's no need to break it now.
Fixes #27480.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Example:
For "http://www.example.com/shop/checkout?order=desc&page=1"
current_page?('http://www.example.com/shop/checkout')
=> true
current_page?(
'http://www.example.com/shop/checkout',
check_parameters: true
)
=> false
|
|
|
|
|
|
| |
Since it affects the entire form, should not mutate `object_name` of class.
Fixes #26931
|
|
|
|
| |
It disables recompilation of templates on every request in test env.
|
|
|
|
| |
Implemented in 67f81cc.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
this lets you pass ruby keywords to templates:
<%= render 'example', class: "cool" %>
<%= render 'example', "spaces are" => "a-ok" %>
<%= render 'example', Foo: "bar" %>
Previously you'd see confusing syntax errors like this:
SyntaxError (.../_example.html.erb:1: syntax error, unexpected '='
Now you can reference invalid identifiers through local_assigns.
If you try to use an invalid keyword (e.g. class) in your template, you
get a syntax error on the line where you use it.
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Implement naive partial caching mechanism.
Add test for LogSubscriber
Use ActionView::Base#log_payload to store log_subscriber's payload, so we can pass cache result into it.
Fixed tests
Remove useless settings
Check if #log_payload exists before calling it. Because other classes also includes CacheHelper but don't have is attribute
Use @log_payload_for_partial_reder instead of #log_payload to carry ActionView's payload.
Update test's hash syntax
Add configuration to enable/disable fragment caching logging
Remove unless test and add new test to ensure cache info won't effect next rendering's log
Move :enable_fragment_cache_logging config from ActionView to ActionPack
Apply new config to tests
Update actionview's changelog
Update configuration guide
Improve actionview's changelog
Refactor PartialRenderer#render and log tests
Mute subscriber's log instead of disabling instrumentation.
Fix typo, remove useless comment and use new hash syntax
Improve actionpack's log_subscriber test
Fix rebase mistake
Apply new config to all caching intstrument actions
|
|
|
|
|
|
|
|
| |
We can safely assume we're not dealing with an infinite collection as
we're about to call `each` on it and collect the results until it
terminates on its own. Given that, `to_a` is implemented by the normal
Array-like objects, and less Array-like objects like `Enumerator` and
`Enumerator::Lazy`.
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
An optimization was introduced in
https://github.com/rails/rails/commit/27f4ffd11a91b534fde9b484cb7c4e515ec0fe77
which tried to `#to_ary` the collection to prevent unnecessary queries
for ActiveRecord scopes/relations. If the given collection did not
respond to `#to_ary`, and empty collection was returned. That meant you
couldn't use collections built from `Enumerator` nor `Enumerable`.
With this change, `#collection_from_options` will attempt the
optimization, but fall back to passing along the given collection,
as-is.
|
| |
|