rails/actionview
neumayr ead4776b82 Fix field_error_proc wrap form select optgroup and divider option tag
### 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`
2017-11-09 17:37:06 +01:00
..
app/assets/javascripts Enable to call Rails.ajax without beforeSend 2017-10-28 12:13:19 +09:00
bin Use frozen string literal in actionview/ 2017-07-24 11:53:43 +03:00
lib Fix field_error_proc wrap form select optgroup and divider option tag 2017-11-09 17:37:06 +01:00
test Fix field_error_proc wrap form select optgroup and divider option tag 2017-11-09 17:37:06 +01:00
.gitignore Add rails-ujs to Action View 2016-11-26 01:23:07 -05:00
actionview.gemspec Use frozen string literal in actionview/ 2017-07-24 11:53:43 +03:00
blade.yml Add rails-ujs to Action View 2016-11-26 01:23:07 -05:00
CHANGELOG.md Fix field_error_proc wrap form select optgroup and divider option tag 2017-11-09 17:37:06 +01:00
coffeelint.json Test rails-ujs in our travis matrix 2017-02-22 13:49:28 -05:00
MIT-LICENSE Bump license years for 2017 2016-12-31 08:34:08 -05:00
package.json Fix test directory to correct path 2017-07-30 16:28:10 +09:00
Rakefile Return correct exit status of ujs test 2017-10-20 15:08:48 +09:00
README.rdoc Update MIT licenses link [ci skip] 2017-08-22 08:46:02 +09:00
RUNNING_UJS_TESTS.rdoc Wrong rake task name in the document 2016-12-24 07:04:34 +09:00
RUNNING_UNIT_TESTS.rdoc [ci skip] /sqlite/i --> SQLite 2014-07-06 15:23:12 +05:30

= Action View

Action View is a framework for handling view template lookup and rendering, and provides
view helpers that assist when building HTML forms, Atom feeds and more.
Template formats that Action View handles are ERB (embedded Ruby, typically
used to inline short Ruby snippets inside HTML), and XML Builder.

== Download and installation

The latest version of Action View can be installed with RubyGems:

  $ gem install actionview

Source code can be downloaded as part of the Rails project on GitHub

* https://github.com/rails/rails/tree/master/actionview


== License

Action View is released under the MIT license:

* https://opensource.org/licenses/MIT


== Support

API documentation is at

* http://api.rubyonrails.org

Bug reports can be filed for the Ruby on Rails project here:

* https://github.com/rails/rails/issues

Feature requests should be discussed on the rails-core mailing list here:

* https://groups.google.com/forum/?fromgroups#!forum/rubyonrails-core