simple_form 2.1.3 → 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.

Potentially problematic release.


This version of simple_form might be problematic. Click here for more details.

Files changed (74) hide show
  1. checksums.yaml +4 -4
  2. data/CHANGELOG.md +21 -51
  3. data/README.md +195 -161
  4. data/lib/generators/simple_form/install_generator.rb +4 -4
  5. data/lib/generators/simple_form/templates/README +2 -2
  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 +16 -16
  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 -320
  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 +154 -50
  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 -5
  26. data/lib/simple_form/inputs/collection_input.rb +7 -7
  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 -99
  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 +62 -63
  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 +24 -24
  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 -51
  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 +77 -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: e0846cac8facbc990fc17731962d98598a2e40ee
4
- data.tar.gz: 4e1b4b5645eb07f7273b89b4a50007a6cc72fb82
3
+ metadata.gz: 1bda3ec212b0e4f1da3e765b704b417893098679
4
+ data.tar.gz: 81b0e670aae4612d40793b872f6fc553fd6d05ab
5
5
  SHA512:
6
- metadata.gz: 0aeca7d6cf3e6ea92299c4a55f7483e5f9ef3c49fc9497840cb11109eb57872cebc98b71c49669b5334cd8409dae300e40409fae39c0d9f2634060fdf65fb95c
7
- data.tar.gz: 7c9fe5310c7403486fbbeeeb2f4633fb9e6987b6c22e663d727e6eacd41f357252a705ac31e5e91cf03575cc053b153f7fa1ff3f31b0545b9ce82ffb34510582
6
+ metadata.gz: e242bc383e74b99f508350376d007c18bd7aedb325632d2d3a8a28043275efa03a9c5b90e6d4a00cec68b53de6636bdb43b3a0af5a83160b8a8bad88919d6248
7
+ data.tar.gz: 70b1845d8a357e8e4ff85def7540d849a8fcd4d070a78e185f2c369da7a453b7def368309dc3339a5a5c2b2f8f47613db2be328ac0dbbb90c3fa74aef996f80a
data/CHANGELOG.md CHANGED
@@ -1,57 +1,27 @@
1
- ## 2.1.3
1
+ ## 3.0.0
2
+
3
+ ### enhancements
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)
2
15
 
3
16
  ### bug fix
4
- * Fix method reflection for Ruby 2.1+. [@badosu](https://github.com/badosu)
5
- * Collection input generates `required` attribute if it has `prompt` option. [@nashby](https://github.com/nashby)
6
- * Use the given name in `input_html` for the hidden field in `collection_check_boxes` [@angelic](https://github.com/angelic)
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)
7
20
  * Add "checkbox" class to the label of boolean input when there is no `:label`
8
21
  in `generate_additional_classes_for` config option [@nashby](https://github.com/nashby)
9
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)
10
26
 
11
- ## 2.1.2
12
-
13
- ### bug fix
14
- * Fix XSS vulnerability on error components.
15
-
16
- ## 2.1.1
17
-
18
- ### bug fix
19
- * Fix XSS vulnerability on label, hint and error components.
20
-
21
- ## 2.1.0
22
-
23
- ### enhancements
24
- * `input_field` supports components that don't generate tags
25
- as `:min_max`, `:maxlength`, `:placeholder`, `:pattern`, `:readonly`.
26
- Closes [#362](https://github.com/plataformatec/simple_form/issues/632).
27
- ([@nashby](https://github.com/nashby))
28
- * support for Rails eager loading.
29
- Closes [#478](https://github.com/plataformatec/simple_form/issues/478).
30
- * generate required attribute for `date_time` input.
31
- ([@nashby](https://github.com/nashby))
32
- Closes [#730](https://github.com/plataformatec/simple_form/issues/730).
33
- * `grouped_collection_select` now accepts proc/lambda as label and value method.
34
- ([@svendahlstrand](https://github.com/svendahlstrand))
35
- Closes [#623](https://github.com/plataformatec/simple_form/issues/623).
36
- * Add Zurb Foundation 3 integration.
37
- ([@balexand](https://github.com/balexand))
38
- * Generates additional wrapper class based on object + attribute name.
39
- ([@lucasmazza](https://github.com/lucasmazza))
40
- Closes [#576](https://github.com/plataformatec/simple_form/issues/576).
41
- * Allow `input_field` to work with `:defaults` options.
42
- ([@smidwap](https://github.com/smidwap))
43
-
44
- ### bug fix
45
- * Do not lookup for hints if it was explicitly given false.
46
- After #405 we added hint classes for the wrappers, but this has forced the
47
- loading of the hint text doing I18n lookups, even though it was explicitly
48
- given false. This checks for the option in `#has_hint?`, avoiding the lookup
49
- in such cases. This issues has been caught with #627, thanks to
50
- ([@shwoodard](https://github.com/shwoodard)).
51
- * Fix default I18n lookup for association input.
52
- ([@nashby](https://github.com/nashby))
53
- Closes [#679](https://github.com/plataformatec/simple_form/issues/679).
54
- * Fix escaping issue in `label_input` component
55
- ([@allomov](https://github.com/allomov))
56
-
57
- 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.