aboutsummaryrefslogtreecommitdiffstats
path: root/actionview/lib/action_view/helpers/form_options_helper.rb
Commit message (Collapse)AuthorAgeFilesLines
* Add AS::TimeZone#match?Akira Matsuda2019-07-291-2/+2
|
* Update time_zone_options_for_select docssshaw2019-05-041-3/+4
|
* Fix typo in collection_radio_buttons spec [ci skip]Alberto Almagro2019-01-111-1/+1
|
* Add `Style/RedundantFreeze` to remove redudant `.freeze`Yasuo Honda2018-09-291-4/+4
| | | | | | | | | | | | | | | | | | | | | Since Rails 6.0 will support Ruby 2.4.1 or higher `# frozen_string_literal: true` magic comment is enough to make string object frozen. This magic comment is enabled by `Style/FrozenStringLiteralComment` cop. * Exclude these files not to auto correct false positive `Regexp#freeze` - 'actionpack/lib/action_dispatch/journey/router/utils.rb' - 'activerecord/lib/active_record/connection_adapters/sqlite3_adapter.rb' It has been fixed by https://github.com/rubocop-hq/rubocop/pull/6333 Once the newer version of RuboCop released and available at Code Climate these exclude entries should be removed. * Replace `String#freeze` with `String#-@` manually if explicit frozen string objects are required - 'actionpack/test/controller/test_case_test.rb' - 'activemodel/test/cases/type/string_test.rb' - 'activesupport/lib/active_support/core_ext/string/strip.rb' - 'activesupport/test/core_ext/string_ext_test.rb' - 'railties/test/generators/actions_test.rb'
* Merge pull request #33547 from Ana06/patch-1Matthew Draper2018-08-231-2/+10
|\ | | | | | | Use public_send in value_for_collection
| * Deprecate use of private methods in view's helpersAna María Martínez Gómez2018-08-081-2/+12
| | | | | | | | | | Instead of dropping it completely in case someone is relying (probably inadvertenly) on it.
| * Use public_send in extract_values_from_collectionAna María Martínez Gómez2018-08-081-1/+1
| | | | | | | | | | | | | | | | | | Avoid exposing private methods in view's helpers. However, as `extract_values_from_collection` is only called from `options_from_collection_for_select` where `value_for_collection` is previously called, this case was already covered. The change makes anyway sense for consistency and in case the code changes in the future.
| * Use public_send in value_for_collectionAna María Martínez Gómez2018-08-071-1/+1
|/ | | | | | Avoid exposing private methods in view's helpers. Fixes https://github.com/rails/rails/issues/33546
* Fix leaking special form_with attributes into html attributesYurii Cherniavskyi2018-07-201-6/+6
| | | | | Special form_with attributes `skip_default_ids` and `allow_method_names_outside_object` attributes are leaking into html attributes of option select tag helpers.
* Use consistent spacing in actionview helper docs [ci skip]Olivier Lacan2018-04-011-8/+8
| | | | | | | | The spacing in these comments is fairly inconsistent. Array argument contents are often separated with a space from the array literal brackets but in several cases the Hash literal curly braces are tangent to their contents which makes the documentation harder to read in some cases.
* Remove needless blank lines [ci skip]Ryuta Kamizono2017-12-301-2/+0
| | | | This broke the doc.
* Allow the use of callable objects as group methods for grouped selects.Jérémie Bonal2017-12-271-4/+10
| | | | | | 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.
* [Action View] require_relative => requireAkira Matsuda2017-10-211-1/+1
| | | | This basically reverts c4d1a4efeec6f0b5b58222993aa0bec85a19b6a8
* Remove extra spaces in the args in the `time_zone_select` [ci skip]Ryuta Kamizono2017-10-161-6/+6
| | | | Follow up of #30862.
* Fix broken doc layout for action_view [ci skip]Yoshiyuki Hirano2017-08-271-1/+1
|
* Use frozen string literal in actionview/Kir Shatrov2017-07-241-0/+2
|
* [Action View] require => require_relativeAkira Matsuda2017-07-011-1/+1
|
* applies new string literal convention in actionview/libXavier Noria2016-08-061-8/+8
| | | | | The current code base is not uniform. After some discussion, we have chosen to go with double quotes by default.
* Fix docs in collection_radio_buttonsclaudiob2016-07-181-3/+3
| | | | [ci skip] Just some english and `<tt>` tags.
* New syntax for tag helpers i.e. tag.br instead of tag(br) #25195Marek2016-06-271-1/+1
|
* Merge pull request #20625 from Envek/add_country_zones_methodJeremy Daer2016-04-191-4/+5
| | | | Add ActiveSupport::TimeZone.country_zones helper
* minor doc fix [ci skip]Mehmet Emin İNAÇ2015-09-271-3/+3
|
* Add a hidden field on the collection_radio_buttonsMauro George2015-09-241-0/+18
| | | | | This will avoid a error be raised when the only input on the form is the `collection_radio_buttons`.
* Cut string allocations in content_tag_stringschneems2015-07-291-4/+4
| | | | | | content_tag's first argument is will generate a string with an html tag so `:a` will generate: `<a></a>`. When this happens, the symbol is implicitly `to_s`-d so a new string is allocated. We can get around that by using a frozen string instead which This change buys us 74,236 bytes of memory and 1,855 fewer objects per request.
* changes names in guides to better reflect diversity [ci-skip]Thomas Osborn2015-07-021-6/+6
|
* Add gotcha to RDoc of collection_check_boxesMauro George2015-06-131-0/+21
| | | | [ci skip]
* Fix docs markup for option_groups_from_collection_for_select [ci skip]Carlos Antonio da Silva2015-05-191-1/+1
|
* Use ruby 1.9 lambda syntax in documentations [ci skip]Mehmet Emin İNAÇ2015-05-031-1/+1
|
* [ci skip] correct output of selectKuldeep Aggarwal2015-03-131-15/+15
|
* [CI SKIP] Correct output of options_for_selectAkshay Vishnoi2015-03-131-5/+5
|
* Pass symbol as an argument instead of a blockErik Michaels-Ober2014-11-291-2/+2
|
* Uppercase HTML in docs.Hendy Tanata2014-08-081-3/+3
| | | | [skip ci]
* docs, cleanup mixed indents within `form_options_helper.rb` RDoc.Yves Senn2014-07-291-81/+81
| | | | | | | [ci skip] This fixes the broken code block rendering and indents the examples within the parameter list.
* docs, `select` and friends with `multiple=true` include a blank string.Yves Senn2014-07-171-5/+3
| | | | | | | | | | | | | | [Jonas Baumann & Yves Senn] The submitted params from a select with `multiple: true` look as follows: ``` {post: {category: [""]}} {post: {category: ["", "Category 1", "Category 2"]}} ``` This is a follow up to #1552.
* Do not overwrite selected and disabled attributesLaura Paredes2014-03-301-2/+2
|
* Typo and grammatical fixes [ci skip]Akshay Vishnoi2013-12-021-1/+1
|
* Revert "Merge pull request #13027 from akshay-vishnoi/f-refactor"Carlos Antonio da Silva2013-11-251-1/+1
| | | | | | | | | | | This reverts commit f4a5a9ea4d183f4102796215d4502c46dbe3e52b, reversing changes made to 7ccb482181ee6c47c765406009018a15172812de. Reason: The logic is different, the first call to #option_value_selected? is for the :selected option (the argument is the "selected" variable), the second call is for the :disabled option (the argument is the "disabled" variable).
* avoiding calling of #option_value_selected? two timesAkshay Vishnoi2013-11-251-1/+1
|
* Expand select documentation to tell about the blockRafael Mendonça França2013-09-231-0/+9
| | | | [ci skip]
* Ability to pass block to AV#select helperBogdan Gusiev2013-09-231-4/+4
| | | | | | | | Example: = select(report, "campaign_ids") do - available_campaigns.each do |c| %option{:data => {:tags => c.tags.to_json}, :value => c.id}= c.name
* RDoc tweaksXavier Noria2013-08-071-5/+10
|
* Leave the knowledge of boolean tag values to content tagCarlos Antonio da Silva2013-07-221-3/+3
| | | | | | content tag already knows which tags are boolean and the values that should generate them when a truthy value is passed, so leave this logic for it instead of duplicating when generating options tags.
* Use merge! to avoid a new hash and change some spots to 1.9 hash styleCarlos Antonio da Silva2013-07-221-7/+7
|
* syntax fix for f.select doc. [ci skip] .Karunakar (Ruby)2013-07-221-1/+1
|
* add support for html attributes to grouped_options_for_selectVasiliy Ermolovich2013-07-201-1/+5
|
* Remove passing the prompt to grouped_options_for_select as an argument, ↵kennyj2013-06-281-9/+2
| | | | because it was deprecated.
* Fix documentation for grouped_collection_select [ci skip]Artyom2013-06-271-1/+1
|
* Fix typo in docs. HABTM associations should use a pluralized namemariozig2013-06-251-1/+1
|
* Move actionpack/lib/action_view* into actionview/libPiotr Sarnacki2013-06-201-0/+832