1. 28 12月, 2017 1 次提交
  2. 10 11月, 2017 1 次提交
    • N
      Fix field_error_proc wrap form select optgroup and divider option tag · ead4776b
      neumayr 提交于
      ### 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`
      ead4776b
  3. 16 8月, 2017 1 次提交
    • K
      Fix RuboCop offenses · 7c260ae2
      Koichi ITO 提交于
      And enable `context_dependent` of Style/BracesAroundHashParameters cop.
      7c260ae2
  4. 24 7月, 2017 1 次提交
  5. 17 7月, 2017 1 次提交
    • R
      Enable `Layout/FirstParameterIndentation` cop · 4183d5df
      Ryuta Kamizono 提交于
      We have some indentation cops. But now there is a little inconsistent
      params indentations. Enable `Layout/FirstParameterIndentation` cop to
      prevent newly inconsistent indentation added and auto-correct to
      existing violations.
      4183d5df
  6. 02 7月, 2017 1 次提交
  7. 01 7月, 2017 1 次提交
  8. 17 5月, 2017 1 次提交
    • S
      Fix select tag helper used with Enumerable choices · efe62b71
      Sam Pohlenz 提交于
      Allows a custom object implementing Enumerable to be used as the choices
      parameter for a select tag, which previously wasn't possible due to the
      call to `empty?` on the choices (which isn't implemented on Enumerable).
      efe62b71
  9. 12 1月, 2017 1 次提交
  10. 29 10月, 2016 1 次提交
  11. 16 8月, 2016 1 次提交
  12. 07 8月, 2016 6 次提交
  13. 29 6月, 2016 1 次提交
  14. 19 5月, 2016 1 次提交
  15. 20 1月, 2016 1 次提交
  16. 22 11月, 2015 3 次提交
  17. 24 9月, 2015 1 次提交
  18. 08 6月, 2015 1 次提交
    • G
      Raise an ArgumentError when `include_blank` is false for a required field in · 07754073
      Grey Baker 提交于
      `Tags::Base#select_content_tag`.
      
      Previously, passing a falsey value to `include_blank` would be ignored if the
      field was required, and a blank line would still be inserted. The following will
      now raise instead of quietly failing:
      
      `select("post", "category", %w(a required field), { include_blank: false }, required: 'required')`
      07754073
  19. 05 8月, 2014 1 次提交
  20. 01 4月, 2014 1 次提交
  21. 23 9月, 2013 2 次提交
  22. 18 9月, 2013 1 次提交
    • S
      There's no need to do this · 949c4291
      Santiago Pastorino 提交于
      AS does the following inside Time.find_zone! ...
      `ActiveSupport::TimeZone[time_zone] || TZInfo::Timezone.get(time_zone)`
      and given that the test is stubbing AS::TZ[] we don't need the removed
      code.
      949c4291
  23. 20 7月, 2013 1 次提交
  24. 28 6月, 2013 1 次提交
  25. 20 6月, 2013 1 次提交
  26. 11 4月, 2013 1 次提交
  27. 05 4月, 2013 1 次提交
  28. 03 4月, 2013 1 次提交
  29. 28 3月, 2013 2 次提交
    • B
      Add regression test for TZ grep · 53d68bd9
      Brian McManus 提交于
      Added a regression test that will fail if anyone tries to change
      time_zone_select to use grep again thinking it will work when it does
      not.
      53d68bd9
    • B
      Revert grep to select since they are not the same · 1cc991be
      Brian McManus 提交于
      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 =~.
      1cc991be
  30. 09 3月, 2013 1 次提交
    • O
      Fix incorrectly appended square brackets to a multiple select box · 8e05a6f6
      Olek Janiszewski 提交于
      If an explicit name has been given and it already ends with "[]"
      
      Before:
      
          select(:category, [], {}, multiple: true, name: "post[category][]")
          # => <select name="post[category][][]" ...>
      
      After:
      
          select(:category, [], {}, multiple: true, name: "post[category][]")
          # => <select name="post[category][]" ...>
      8e05a6f6
  31. 22 2月, 2013 1 次提交