simple_form 2.1.0 → 3.0.0

Sign up to get free protection for your applications and to get access to all the features.

Potentially problematic release.


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

Files changed (69) hide show
  1. checksums.yaml +7 -0
  2. data/CHANGELOG.md +22 -32
  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/form_helper.rb +2 -9
  11. data/lib/simple_form/components/html5.rb +5 -2
  12. data/lib/simple_form/components/labels.rb +3 -3
  13. data/lib/simple_form/components/maxlength.rb +1 -8
  14. data/lib/simple_form/components/pattern.rb +2 -2
  15. data/lib/simple_form/components.rb +1 -1
  16. data/lib/simple_form/error_notification.rb +2 -2
  17. data/lib/simple_form/form_builder.rb +155 -51
  18. data/lib/simple_form/helpers.rb +1 -1
  19. data/lib/simple_form/inputs/base.rb +6 -6
  20. data/lib/simple_form/inputs/block_input.rb +1 -1
  21. data/lib/simple_form/inputs/boolean_input.rb +6 -4
  22. data/lib/simple_form/inputs/collection_input.rb +6 -6
  23. data/lib/simple_form/inputs/date_time_input.rb +1 -1
  24. data/lib/simple_form/inputs/numeric_input.rb +0 -6
  25. data/lib/simple_form/inputs/password_input.rb +0 -1
  26. data/lib/simple_form/inputs/string_input.rb +0 -1
  27. data/lib/simple_form/railtie.rb +7 -0
  28. data/lib/simple_form/tags.rb +62 -0
  29. data/lib/simple_form/version.rb +1 -1
  30. data/lib/simple_form/wrappers/builder.rb +5 -29
  31. data/lib/simple_form/wrappers/many.rb +1 -1
  32. data/lib/simple_form/wrappers/root.rb +1 -1
  33. data/lib/simple_form/wrappers.rb +1 -1
  34. data/lib/simple_form.rb +43 -47
  35. data/test/action_view_extensions/builder_test.rb +78 -92
  36. data/test/action_view_extensions/form_helper_test.rb +25 -16
  37. data/test/components/label_test.rb +46 -46
  38. data/test/form_builder/association_test.rb +47 -29
  39. data/test/form_builder/button_test.rb +4 -4
  40. data/test/form_builder/error_notification_test.rb +8 -8
  41. data/test/form_builder/error_test.rb +12 -12
  42. data/test/form_builder/general_test.rb +71 -52
  43. data/test/form_builder/hint_test.rb +22 -22
  44. data/test/form_builder/input_field_test.rb +29 -12
  45. data/test/form_builder/label_test.rb +7 -7
  46. data/test/form_builder/wrapper_test.rb +21 -21
  47. data/test/inputs/boolean_input_test.rb +35 -23
  48. data/test/inputs/collection_check_boxes_input_test.rb +66 -55
  49. data/test/inputs/collection_radio_buttons_input_test.rb +81 -79
  50. data/test/inputs/collection_select_input_test.rb +76 -45
  51. data/test/inputs/datetime_input_test.rb +17 -11
  52. data/test/inputs/disabled_test.rb +10 -10
  53. data/test/inputs/discovery_test.rb +4 -4
  54. data/test/inputs/file_input_test.rb +1 -1
  55. data/test/inputs/general_test.rb +28 -12
  56. data/test/inputs/grouped_collection_select_input_test.rb +33 -20
  57. data/test/inputs/hidden_input_test.rb +3 -2
  58. data/test/inputs/numeric_input_test.rb +3 -3
  59. data/test/inputs/priority_input_test.rb +9 -3
  60. data/test/inputs/readonly_test.rb +12 -12
  61. data/test/inputs/required_test.rb +5 -5
  62. data/test/inputs/string_input_test.rb +15 -25
  63. data/test/inputs/text_input_test.rb +1 -1
  64. data/test/support/misc_helpers.rb +46 -24
  65. data/test/support/mock_controller.rb +6 -6
  66. data/test/support/models.rb +80 -62
  67. data/test/test_helper.rb +17 -34
  68. metadata +31 -29
  69. data/lib/simple_form/core_ext/hash.rb +0 -16
checksums.yaml ADDED
@@ -0,0 +1,7 @@
1
+ ---
2
+ SHA1:
3
+ metadata.gz: 1bda3ec212b0e4f1da3e765b704b417893098679
4
+ data.tar.gz: 81b0e670aae4612d40793b872f6fc553fd6d05ab
5
+ SHA512:
6
+ metadata.gz: e242bc383e74b99f508350376d007c18bd7aedb325632d2d3a8a28043275efa03a9c5b90e6d4a00cec68b53de6636bdb43b3a0af5a83160b8a8bad88919d6248
7
+ data.tar.gz: 70b1845d8a357e8e4ff85def7540d849a8fcd4d070a78e185f2c369da7a453b7def368309dc3339a5a5c2b2f8f47613db2be328ac0dbbb90c3fa74aef996f80a
data/CHANGELOG.md CHANGED
@@ -1,37 +1,27 @@
1
- ## 2.1.0
1
+ ## 3.0.0
2
2
 
3
3
  ### enhancements
4
- * `input_field` supports components that don't generate tags
5
- as `:min_max`, `:maxlength`, `:placeholder`, `:pattern`, `:readonly`.
6
- Closes[#362](https://github.com/plataformatec/simple_form/issues/632).
7
- ([@nashby](https://github.com/nashby))
8
- * support for Rails eager loading.
9
- Closes [#478](https://github.com/plataformatec/simple_form/issues/478).
10
- * generate required attribute for `date_time` input.
11
- ([@nashby](https://github.com/nashby))
12
- Closes [#730](https://github.com/plataformatec/simple_form/issues/730).
13
- * `grouped_collection_select` now accepts proc/lambda as label and value method.
14
- ([@svendahlstrand](https://github.com/svendahlstrand))
15
- Closes [#623](https://github.com/plataformatec/simple_form/issues/623).
16
- * Add Zurb Foundation 3 integration.
17
- ([@balexand](https://github.com/balexand))
18
- * Generates additional wrapper class based on object + attribute name.
19
- ([@lucasmazza](https://github.com/lucasmazza))
20
- Closes [#576](https://github.com/plataformatec/simple_form/issues/576).
21
- * Allow `input_field` to work with `:defaults` options.
22
- ([@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)
23
15
 
24
16
  ### bug fix
25
- * Do not lookup for hints if it was explicitly given false.
26
- After #405 we added hint classes for the wrappers, but this has forced the
27
- loading of the hint text doing I18n lookups, even though it was explicitly
28
- given false. This checks for the option in `#has_hint?`, avoiding the lookup
29
- in such cases. This issues has been caught with #627, thanks to
30
- ([@shwoodard](https://github.com/shwoodard)).
31
- * Fix default I18n lookup for association input.
32
- ([@nashby](https://github.com/nashby))
33
- Closes [#679](https://github.com/plataformatec/simple_form/issues/679).
34
- * Fix escaping issue in `label_input` component
35
- ([@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)
36
26
 
37
- 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.