aboutsummaryrefslogtreecommitdiffstats
path: root/actionpack/lib/action_view/helpers/form_options_helper.rb
Commit message (Collapse)AuthorAgeFilesLines
* Merge pull request #9680 from bdmac/time-zone-options-revert-grep-to-selectCarlos Antonio da Silva2013-03-311-1/+1
|\ | | | | Revert grep to select since they are not the same
| * Revert grep to select since they are not the sameBrian McManus2013-03-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 =~.
* | remove unused variable and assignmentVipul A M2013-03-311-1/+1
|/
* Use #grep to filter priority zones when a regexp is givenCarlos Antonio da Silva2013-02-211-1/+1
|
* Use Array Difference to calculate the zones array, instead of iteratingCarlos Antonio da Silva2013-02-211-2/+2
| | | | It's faster, and doesn't force us to dup the timezones array.
* Fix time_zone_options_for_select to not mutate TimeZones arrayBrian McManus2013-02-191-1/+1
| | | | | | | | | | 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.
* Missing or unneeded require extract_optionsAkira Matsuda2013-02-011-0/+1
|
* Merge remote-tracking branch 'docrails/master'Xavier Noria2013-01-261-0/+48
|\ | | | | | | | | | | Conflicts: actionpack/lib/action_view/helpers/form_options_helper.rb guides/code/getting_started/app/controllers/comments_controller.rb
| * generic pass before merging docrailsXavier Noria2013-01-261-274/+36
| |
| * repeating documentation for option form helpersThiago Pinto2013-01-171-0/+286
| |
* | Collection radio buttons and collection check boxes through FormBuilder renderJosé Mota2013-01-121-4/+4
|/ | | | | | | | 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.
* Change docs to use update instead of update_attributesAmparo Luna + Guillermo Iguaran2013-01-031-1/+1
|
* Add missing require.Rafael Mendonça França2012-12-131-0/+1
| | | | | I was trying to use those files without Rails and that require was missing.
* Cleans and removes useless 'Examples' tag [ci skip]Alvaro Pereyra2012-12-011-48/+43
|
* No sort Hash options in #grouped_options_for_selectSergey Kojin2012-11-271-6/+4
|
* Fix message about include_blank option.Steve Klabnik + Katrina Owen2012-11-091-1/+1
| | | | | See https://github.com/rails/rails/commit/cb7d19b66badfbd1846c195913419c331701074e#commitcomment-2127148.
* Merge branch 'master' of github.com:lifo/docrailsVijay Dev2012-11-031-22/+22
|\ | | | | | | | | | | | | Conflicts: actionpack/lib/action_controller/metal/mime_responds.rb activerecord/lib/active_record/attribute_methods.rb guides/source/working_with_javascript_in_rails.md
| * Hash Syntax to 1.9 related changesAvnerCohen2012-10-291-22/+22
| |
* | Make caller attribute in deprecation methods optionalAlexey Gaziev2012-10-301-1/+1
| |
* | Fix failing tests and use new hash style in deprecation messagesCarlos Antonio da Silva2012-10-291-1/+1
| |
* | Provide a call stack for deprecation warnings where needed.Nikita Afanasenko2012-10-291-1/+3
|/ | | | 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 a doc example output in match actual outputEvan Farrar2012-08-151-4/+4
| | | | | Make doc output in grouped_options_for_select divider example match actual output. The options groups were in backwards order of actual.
* Ensure option_html_attributes does not modify the given option hashesCarlos Antonio da Silva2012-08-111-1/+1
| | | | We can avoid creating extra hashes with #merge, and use #merge! instead.
* Simplify html attributes generation for options_for_selectCarlos Antonio da Silva2012-08-111-3/+5
| | | | | | | 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).
* load active_support/core_ext/object/blank in active_support/railsXavier Noria2012-08-021-1/+0
|
* don't escape options in option_html_attributes methodVasiliy Ermolovich2012-07-221-1/+1
| | | | | | | | 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
* Fixed bug creating invalid HTML in select optionsRusty Geldmacher2012-07-101-1/+1
| | | | | | 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.
* Clarify grouped_options_for_select method API, add changelog entryCarlos Antonio da Silva2012-05-191-14/+13
| | | | | | | | | | | | 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.
* Document the usage of grouped_options_for_select with divider optionRafael Mendonça França2012-05-161-1/+19
|
* Make :prompt work as documentedRafael Mendonça França2012-05-161-1/+8
|
* Test deprecation and fix the documentation of grouped_options_for_selectRafael Mendonça França2012-05-161-1/+4
|
* Add separator argument to grouped_options_for_selectGreenie05062012-05-151-2/+17
| | | | Change prompt to options hash in grouped_options_for_select
* Removing ==Examples and last blank lines of docs from actionpackFrancesco Rodriguez2012-05-151-1/+0
|
* Documentation fix in options_for_select helper. Fixed display errors caused ↵Rodrigo Pavano2012-05-011-9/+26
| | | | by mixing Ruby and HTML code inside the same pre tag [ci skip]
* add 'include_hidden' option to select tag, closes #5402Vasiliy Ermolovich2012-03-131-0/+2
|
* Add documentation to object method of CollectionHelpers::BuilderRafael Mendonça França2012-02-261-6/+6
|
* refactor option_text_and_value and option_value_selected? methodsVasiliy Ermolovich2012-02-211-10/+3
|
* refactor time_zone_options_for_selectVasiliy Ermolovich2012-02-211-7/+8
| | | | | | | | | | | | | | | 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)
* refactor options_for_selectVasiliy Ermolovich2012-02-201-7/+8
|
* refactor grouped_options_for_selectVasiliy Ermolovich2012-02-201-5/+5
|
* Remove default class to collection_check_boxes andRafael Mendonça França2012-02-021-8/+8
| | | | | | collection_radio_buttons [Carlos Antonio da Silva + Rafael Mendonça França]
* Allow collection radio_buttons/check_boxes to access current text/valueCarlos Antonio da Silva2012-02-021-0/+14
| | | | [Carlos Antonio da Silva + Rafael Mendonça França]
* Add changelog, docs and guides entriesCarlos Antonio da Silva2012-02-021-17/+63
| | | | [Carlos Antonio da Silva + Rafael Mendonça França]
* Allow proc for value/text method in collection_selectCarlos Antonio da Silva2012-02-021-2/+6
| | | | | | And options_from_collection_for_select as well. [Carlos Antonio da Silva + Rafael Mendonça França]
* Move collection radio buttons / check boxes back to FormOptionsHelperCarlos Antonio da Silva2012-02-021-0/+75
| | | | [Carlos Antonio da Silva + Rafael Mendonça França]
* Cleanup options helper methods a bitCarlos Antonio da Silva2012-02-021-12/+12
| | | | [Carlos Antonio da Silva + Rafael Mendonça França]
* Refactor option groups to use content_tagCarlos Antonio da Silva2012-02-021-4/+4
| | | | [Carlos Antonio da Silva + Rafael Mendonça França]
* Move collection_check_boxes and collection_radio_buttons to they ourRafael Mendonça França2012-02-021-8/+0
| | | | | | module [Carlos Antonio da Silva + Rafael Mendonça França]
* Add collection_check_boxes helperCarlos Antonio da Silva2012-02-021-0/+4
| | | | [Carlos Antonio da Silva + Rafael Mendonça França]
* Create collection_radio_buttons helperCarlos Antonio da Silva2012-02-021-0/+4
| | | | [Carlos Antonio da Silva + Rafael Mendonça França]