| Commit message (Collapse) | Author | Age | Files | Lines |
|\
| |
| | |
Revert grep to select since they are not the same
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
A previous commit swapped out a call to select for a call to grep in
time_zone_options_for_select. This behavior actually causes the
regexp priority option to stop working.
ActiveSupport::TimeZone overrides the =~ operator which is what the
select block was using previously. Enumerable#grep
checks pattern === element and in this case that would be /US/ ===
ActiveSupport::TimeZone which does not work because
ActiveSupport::TimeZone does not supply an implicit converting to_str
method, only an explicit to_s method.
It would be impossible to provide a to_str method that behaves
identically to the =~ method provided on ActiveSupport::TimeZone
so the only option is to revert back to using select with =~.
|
|/ |
|
| |
|
|
|
|
| |
It's faster, and doesn't force us to dup the timezones array.
|
|
|
|
|
|
|
|
|
|
| |
Previous implementation of time_zone_options_for_select did not dup the
ActiveSupport::TimeZone.all array. When :priority_zones were provided
the method would reject! the zones from the memoized TimeZones array
thus affecting future requests to the server. Essentially whatever
zones were specified as :priority_zones would show up for the first
request but then disappear from the time zone options on future
requests.
|
| |
|
|\
| |
| |
| |
| |
| | |
Conflicts:
actionpack/lib/action_view/helpers/form_options_helper.rb
guides/code/getting_started/app/controllers/comments_controller.rb
|
| | |
|
| | |
|
|/
|
|
|
|
|
|
| |
the provided block.
In the case of having a form_for method being called, the block for each
collection would not be passed and thus the result expected was always the same.
This patch passes the block to the original method like it would be assumed.
|
| |
|
|
|
|
|
| |
I was trying to use those files without Rails and that require was
missing.
|
| |
|
| |
|
|
|
|
|
| |
See
https://github.com/rails/rails/commit/cb7d19b66badfbd1846c195913419c331701074e#commitcomment-2127148.
|
|\
| |
| |
| |
| |
| |
| | |
Conflicts:
actionpack/lib/action_controller/metal/mime_responds.rb
activerecord/lib/active_record/attribute_methods.rb
guides/source/working_with_javascript_in_rails.md
|
| | |
|
| | |
|
| | |
|
|/
|
|
| |
It's sometimes hard to quickly find where deprecated call was performed, especially in case of migrating between Rails versions. So this is an attempt to improve the call stack part of the warning message by providing caller explicitly.
|
|
|
|
|
| |
Make doc output in grouped_options_for_select divider example match
actual output. The options groups were in backwards order of actual.
|
|
|
|
| |
We can avoid creating extra hashes with #merge, and use #merge! instead.
|
|
|
|
|
|
|
| |
Further simplify the option_html_attributes method after the changes
introduced in dacbcbe55745aa9e5484b10b11f65ccca7db1c54 to not escape the
html options here (since they're going to be escaped down the chain in
content tag).
|
| |
|
|
|
|
|
|
|
|
| |
we don't need to escape values in this method as we pass
these html attributes to `tag_options` method that handle escaping as
well.
it fixes the case when we want to pass html5 data options
|
|
|
|
|
|
| |
When a select tag is created for a field with errors, then the inserted
options will errantly have a <div class="field_with_errors"> wrapping
them.
|
|
|
|
|
|
|
|
|
|
|
|
| |
Make the method API more clear by explicitly showing the expected
arguments. This means that the options cannot be passed as second
argument because we are not relying on extract_options! anymore,
you are expected to give a selected key or `nil` if you want to pass
options, as it is the last argument.
Notice that this does not change the current method arguments contract
available in 3.2, it just brings back the same functionality with the
divider addition.
|
| |
|
| |
|
| |
|
|
|
|
| |
Change prompt to options hash in grouped_options_for_select
|
| |
|
|
|
|
| |
by mixing Ruby and HTML code inside the same pre tag [ci skip]
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
BTW, select works quite faster then find_all:
require 'benchmark'
n = [1]*100_000_000
Benchmark.bm do |x|
x.report { n.select { |a| a > 1 } }
x.report { n.find_all { |a| a > 1 } }
end
user system total real
7.590000 0.010000 7.600000 ( 7.927171)
9.650000 0.010000 9.660000 ( 9.634406)
|
| |
|
| |
|
|
|
|
|
|
| |
collection_radio_buttons
[Carlos Antonio da Silva + Rafael Mendonça França]
|
|
|
|
| |
[Carlos Antonio da Silva + Rafael Mendonça França]
|
|
|
|
| |
[Carlos Antonio da Silva + Rafael Mendonça França]
|
|
|
|
|
|
| |
And options_from_collection_for_select as well.
[Carlos Antonio da Silva + Rafael Mendonça França]
|
|
|
|
| |
[Carlos Antonio da Silva + Rafael Mendonça França]
|
|
|
|
| |
[Carlos Antonio da Silva + Rafael Mendonça França]
|
|
|
|
| |
[Carlos Antonio da Silva + Rafael Mendonça França]
|
|
|
|
|
|
| |
module
[Carlos Antonio da Silva + Rafael Mendonça França]
|
|
|
|
| |
[Carlos Antonio da Silva + Rafael Mendonça França]
|
|
|
|
| |
[Carlos Antonio da Silva + Rafael Mendonça França]
|