simple_form 2.1.2 → 3.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +22 -42
  3. data/README.md +161 -119
  4. data/lib/generators/simple_form/install_generator.rb +3 -3
  5. data/lib/generators/simple_form/templates/README +1 -1
  6. data/lib/generators/simple_form/templates/config/initializers/simple_form.rb +16 -13
  7. data/lib/generators/simple_form/templates/config/initializers/simple_form_bootstrap.rb +14 -14
  8. data/lib/generators/simple_form/templates/config/initializers/simple_form_foundation.rb +3 -3
  9. data/lib/simple_form/action_view_extensions/builder.rb +1 -319
  10. data/lib/simple_form/action_view_extensions/builder.rb.orig +247 -0
  11. data/lib/simple_form/action_view_extensions/form_helper.rb +2 -9
  12. data/lib/simple_form/components/errors.rb +1 -7
  13. data/lib/simple_form/components/hints.rb +2 -7
  14. data/lib/simple_form/components/html5.rb +5 -2
  15. data/lib/simple_form/components/labels.rb +4 -4
  16. data/lib/simple_form/components/maxlength.rb +1 -8
  17. data/lib/simple_form/components/pattern.rb +2 -2
  18. data/lib/simple_form/components.rb +1 -1
  19. data/lib/simple_form/error_notification.rb +2 -2
  20. data/lib/simple_form/form_builder.rb +155 -51
  21. data/lib/simple_form/form_builder.rb.orig +486 -0
  22. data/lib/simple_form/helpers.rb +1 -1
  23. data/lib/simple_form/inputs/base.rb +7 -10
  24. data/lib/simple_form/inputs/block_input.rb +1 -1
  25. data/lib/simple_form/inputs/boolean_input.rb +6 -4
  26. data/lib/simple_form/inputs/collection_input.rb +6 -6
  27. data/lib/simple_form/inputs/date_time_input.rb +1 -1
  28. data/lib/simple_form/inputs/numeric_input.rb +0 -6
  29. data/lib/simple_form/inputs/password_input.rb +0 -1
  30. data/lib/simple_form/inputs/string_input.rb +0 -1
  31. data/lib/simple_form/railtie.rb +7 -0
  32. data/lib/simple_form/tags.rb +62 -0
  33. data/lib/simple_form/version.rb +1 -1
  34. data/lib/simple_form/version.rb.orig +7 -0
  35. data/lib/simple_form/wrappers/builder.rb +5 -29
  36. data/lib/simple_form/wrappers/many.rb +1 -1
  37. data/lib/simple_form/wrappers/root.rb +1 -1
  38. data/lib/simple_form/wrappers.rb +1 -1
  39. data/lib/simple_form.rb +43 -47
  40. data/test/action_view_extensions/builder_test.rb +78 -92
  41. data/test/action_view_extensions/form_helper_test.rb +25 -16
  42. data/test/components/label_test.rb +46 -46
  43. data/test/form_builder/association_test.rb +47 -29
  44. data/test/form_builder/button_test.rb +4 -4
  45. data/test/form_builder/error_notification_test.rb +8 -8
  46. data/test/form_builder/error_test.rb +18 -65
  47. data/test/form_builder/general_test.rb +73 -54
  48. data/test/form_builder/hint_test.rb +23 -29
  49. data/test/form_builder/input_field_test.rb +29 -12
  50. data/test/form_builder/label_test.rb +7 -17
  51. data/test/form_builder/wrapper_test.rb +21 -21
  52. data/test/inputs/boolean_input_test.rb +35 -23
  53. data/test/inputs/collection_check_boxes_input_test.rb +66 -55
  54. data/test/inputs/collection_radio_buttons_input_test.rb +81 -79
  55. data/test/inputs/collection_select_input_test.rb +76 -45
  56. data/test/inputs/datetime_input_test.rb +17 -11
  57. data/test/inputs/disabled_test.rb +10 -10
  58. data/test/inputs/discovery_test.rb +4 -4
  59. data/test/inputs/file_input_test.rb +1 -1
  60. data/test/inputs/general_test.rb +28 -12
  61. data/test/inputs/grouped_collection_select_input_test.rb +33 -20
  62. data/test/inputs/hidden_input_test.rb +3 -2
  63. data/test/inputs/numeric_input_test.rb +3 -3
  64. data/test/inputs/priority_input_test.rb +9 -3
  65. data/test/inputs/readonly_test.rb +12 -12
  66. data/test/inputs/required_test.rb +5 -5
  67. data/test/inputs/string_input_test.rb +15 -25
  68. data/test/inputs/text_input_test.rb +1 -1
  69. data/test/support/misc_helpers.rb +46 -24
  70. data/test/support/mock_controller.rb +6 -6
  71. data/test/support/models.rb +80 -62
  72. data/test/test_helper.rb +17 -34
  73. metadata +39 -22
  74. data/lib/simple_form/core_ext/hash.rb +0 -16
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: c4f641b8e74ebf64e3fb7fe4ebe925c64713eb13
4
- data.tar.gz: e74db71fa1d985a906d520673cf82504470c16dd
3
+ metadata.gz: 1bda3ec212b0e4f1da3e765b704b417893098679
4
+ data.tar.gz: 81b0e670aae4612d40793b872f6fc553fd6d05ab
5
5
  SHA512:
6
- metadata.gz: bc974c636d805808f4b5fd47e9eec4c656ae53b680113f03eea075dac24a7607c773e1243ceff8201bced0fc849c752def0130efefe5b9d7a24c6e85fc4e176a
7
- data.tar.gz: f7a7f67d9ce616e8f7697558ca957cf2701641c0a149eb06b0dab2b60ba17833f432f7bdeeaf29312ff7606acf70971dea86b8ec4f19198ff6420aa7421d646e
6
+ metadata.gz: e242bc383e74b99f508350376d007c18bd7aedb325632d2d3a8a28043275efa03a9c5b90e6d4a00cec68b53de6636bdb43b3a0af5a83160b8a8bad88919d6248
7
+ data.tar.gz: 70b1845d8a357e8e4ff85def7540d849a8fcd4d070a78e185f2c369da7a453b7def368309dc3339a5a5c2b2f8f47613db2be328ac0dbbb90c3fa74aef996f80a
data/CHANGELOG.md CHANGED
@@ -1,47 +1,27 @@
1
- ## 2.1.2
2
-
3
- ### bug fix
4
- * Fix XSS vulnerability on error components.
5
-
6
- ## 2.1.1
7
-
8
- ### bug fix
9
- * Fix XSS vulnerability on label, hint and error components.
10
-
11
- ## 2.1.0
1
+ ## 3.0.0
12
2
 
13
3
  ### enhancements
14
- * `input_field` supports components that don't generate tags
15
- as `:min_max`, `:maxlength`, `:placeholder`, `:pattern`, `:readonly`.
16
- Closes[#362](https://github.com/plataformatec/simple_form/issues/632).
17
- ([@nashby](https://github.com/nashby))
18
- * support for Rails eager loading.
19
- Closes [#478](https://github.com/plataformatec/simple_form/issues/478).
20
- * generate required attribute for `date_time` input.
21
- ([@nashby](https://github.com/nashby))
22
- Closes [#730](https://github.com/plataformatec/simple_form/issues/730).
23
- * `grouped_collection_select` now accepts proc/lambda as label and value method.
24
- ([@svendahlstrand](https://github.com/svendahlstrand))
25
- Closes [#623](https://github.com/plataformatec/simple_form/issues/623).
26
- * Add Zurb Foundation 3 integration.
27
- ([@balexand](https://github.com/balexand))
28
- * Generates additional wrapper class based on object + attribute name.
29
- ([@lucasmazza](https://github.com/lucasmazza))
30
- Closes [#576](https://github.com/plataformatec/simple_form/issues/576).
31
- * Allow `input_field` to work with `:defaults` options.
32
- ([@smidwap](https://github.com/smidwap))
4
+ * New `input_class` global config option to set a class to be generated in all inputs.
5
+ * Collection tags accept html attributes as the last element of collection [@nashby](https://github.com/nashby)
6
+ * Change default `:value_method` of collection tags from `:last` to `:second` [@nashby](https://github.com/nashby)
7
+ * Support `Proc` object in `:conditions` option of associations [@bradly](https://github.com/bradly)
8
+ * `input_field` supports `html5` component [@nashby](https://github.com/nashby)
9
+ * Make `field_error_proc` configurable [@dfens](https://github.com/dfens)
10
+ * Support to Rails 4.
11
+ * Removed deprecated methods.
12
+ * SimpleForm no longer sets the `size` attribute automatically and the `default_input_size` setting
13
+ is now deprecated.
14
+ * Support to aria-required attribute to required fields [@ckundo](https://github.com/ckundo)
33
15
 
34
16
  ### bug fix
35
- * Do not lookup for hints if it was explicitly given false.
36
- After #405 we added hint classes for the wrappers, but this has forced the
37
- loading of the hint text doing I18n lookups, even though it was explicitly
38
- given false. This checks for the option in `#has_hint?`, avoiding the lookup
39
- in such cases. This issues has been caught with #627, thanks to
40
- ([@shwoodard](https://github.com/shwoodard)).
41
- * Fix default I18n lookup for association input.
42
- ([@nashby](https://github.com/nashby))
43
- Closes [#679](https://github.com/plataformatec/simple_form/issues/679).
44
- * Fix escaping issue in `label_input` component
45
- ([@allomov](https://github.com/allomov))
17
+ * Make `DateTimeInput#label_target` method to work with string values in `I18n.t('date.order')` (default
18
+ behaviour in Rails 4)
19
+ Closes [#846](https://github.com/plataformatec/simple_form/issues/846) [@mjankowski](https://github.com/mjankowski)
20
+ * Add "checkbox" class to the label of boolean input when there is no `:label`
21
+ in `generate_additional_classes_for` config option [@nashby](https://github.com/nashby)
22
+ * Support models with digits in their names [@webgago](https://github.com/webgago)
23
+ * Remove deprecation warnings related to `Relation#all` from Rails 4.
24
+ * Form builder can be used outside the context of a controller [@jasonwebster](https://github.com/jasonwebster)
25
+ * Skip pattern attribute when using `validates_format_of` with `:without` option [@glebm](https://github.com/glebm)
46
26
 
47
- Please check [v2.0](https://github.com/plataformatec/simple_form/blob/v2.0/CHANGELOG.md) for previous changes.
27
+ Please check [v2.1](https://github.com/plataformatec/simple_form/blob/v2.1/CHANGELOG.md) for previous changes.