simple_form 3.0.4 → 3.1.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +45 -45
- data/MIT-LICENSE +1 -1
- data/README.md +204 -81
- data/lib/generators/simple_form/install_generator.rb +3 -3
- data/lib/generators/simple_form/templates/README +3 -4
- data/lib/generators/simple_form/templates/config/initializers/simple_form.rb +28 -7
- data/lib/generators/simple_form/templates/config/initializers/simple_form_bootstrap.rb +115 -24
- data/lib/generators/simple_form/templates/config/initializers/simple_form_foundation.rb +86 -5
- data/lib/generators/simple_form/templates/config/locales/simple_form.en.yml +7 -2
- data/lib/simple_form/action_view_extensions/builder.rb +1 -0
- data/lib/simple_form/action_view_extensions/form_helper.rb +6 -2
- data/lib/simple_form/components/errors.rb +24 -4
- data/lib/simple_form/components/hints.rb +2 -2
- data/lib/simple_form/components/html5.rb +1 -1
- data/lib/simple_form/components/label_input.rb +20 -2
- data/lib/simple_form/components/labels.rb +10 -6
- data/lib/simple_form/components/maxlength.rb +1 -1
- data/lib/simple_form/components/min_max.rb +1 -1
- data/lib/simple_form/components/pattern.rb +1 -1
- data/lib/simple_form/components/placeholders.rb +2 -2
- data/lib/simple_form/components/readonly.rb +1 -1
- data/lib/simple_form/form_builder.rb +122 -74
- data/lib/simple_form/helpers.rb +5 -5
- data/lib/simple_form/inputs/base.rb +34 -12
- data/lib/simple_form/inputs/block_input.rb +1 -1
- data/lib/simple_form/inputs/boolean_input.rb +28 -15
- data/lib/simple_form/inputs/collection_input.rb +30 -9
- data/lib/simple_form/inputs/collection_radio_buttons_input.rb +6 -11
- data/lib/simple_form/inputs/collection_select_input.rb +4 -2
- data/lib/simple_form/inputs/date_time_input.rb +12 -2
- data/lib/simple_form/inputs/file_input.rb +4 -2
- data/lib/simple_form/inputs/grouped_collection_select_input.rb +15 -3
- data/lib/simple_form/inputs/hidden_input.rb +4 -2
- data/lib/simple_form/inputs/numeric_input.rb +5 -4
- data/lib/simple_form/inputs/password_input.rb +4 -2
- data/lib/simple_form/inputs/priority_input.rb +4 -2
- data/lib/simple_form/inputs/range_input.rb +1 -1
- data/lib/simple_form/inputs/string_input.rb +4 -2
- data/lib/simple_form/inputs/text_input.rb +4 -2
- data/lib/simple_form/railtie.rb +7 -0
- data/lib/simple_form/tags.rb +6 -0
- data/lib/simple_form/version.rb +1 -1
- data/lib/simple_form/wrappers/builder.rb +6 -6
- data/lib/simple_form/wrappers/leaf.rb +28 -0
- data/lib/simple_form/wrappers/many.rb +6 -6
- data/lib/simple_form/wrappers/root.rb +1 -1
- data/lib/simple_form/wrappers/single.rb +5 -3
- data/lib/simple_form/wrappers.rb +1 -0
- data/lib/simple_form.rb +59 -8
- data/test/action_view_extensions/builder_test.rb +36 -36
- data/test/action_view_extensions/form_helper_test.rb +33 -14
- data/test/components/label_test.rb +37 -37
- data/test/form_builder/association_test.rb +52 -35
- data/test/form_builder/button_test.rb +10 -10
- data/test/form_builder/error_notification_test.rb +1 -1
- data/test/form_builder/error_test.rb +111 -33
- data/test/form_builder/general_test.rb +89 -64
- data/test/form_builder/hint_test.rb +18 -18
- data/test/form_builder/input_field_test.rb +40 -16
- data/test/form_builder/label_test.rb +45 -13
- data/test/form_builder/wrapper_test.rb +135 -19
- data/test/generators/simple_form_generator_test.rb +4 -4
- data/test/inputs/boolean_input_test.rb +62 -6
- data/test/inputs/collection_check_boxes_input_test.rb +85 -17
- data/test/inputs/collection_radio_buttons_input_test.rb +134 -36
- data/test/inputs/collection_select_input_test.rb +146 -41
- data/test/inputs/datetime_input_test.rb +117 -50
- data/test/inputs/disabled_test.rb +15 -15
- data/test/inputs/discovery_test.rb +56 -6
- data/test/inputs/file_input_test.rb +2 -2
- data/test/inputs/general_test.rb +20 -20
- data/test/inputs/grouped_collection_select_input_test.rb +44 -8
- data/test/inputs/hidden_input_test.rb +4 -4
- data/test/inputs/numeric_input_test.rb +43 -43
- data/test/inputs/priority_input_test.rb +13 -13
- data/test/inputs/readonly_test.rb +19 -19
- data/test/inputs/required_test.rb +13 -13
- data/test/inputs/string_input_test.rb +50 -30
- data/test/inputs/text_input_test.rb +7 -7
- data/test/simple_form_test.rb +8 -0
- data/test/support/discovery_inputs.rb +32 -2
- data/test/support/misc_helpers.rb +71 -5
- data/test/support/models.rb +60 -24
- data/test/test_helper.rb +5 -1
- metadata +5 -5
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA1:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 275599af691b7ba0bd40146940b8936b7b00bb65
|
|
4
|
+
data.tar.gz: bf12768bc9960272a7823e62276f8191a5b293d7
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: f62bec40ad89719416a5010cd0ec3eab18a6322289cd817e732061d4b53dd01e6f749a3a1a89caabe2fa233749d9841dea374365572fa91f8dc70755382d6811
|
|
7
|
+
data.tar.gz: 82930fed0d675a74d7e226ebf39e78ebf86807ba583988959be4f633c50f76e3cbc2e2b924d243ce87e5423089610962dab3f1795eb242ce544d985d702c8f36
|
data/CHANGELOG.md
CHANGED
|
@@ -1,49 +1,49 @@
|
|
|
1
|
-
## 3.0
|
|
2
|
-
|
|
3
|
-
### bug fix
|
|
4
|
-
* Fix method reflection for Ruby 2.1+. [@badosu](https://github.com/badosu)
|
|
5
|
-
* Do not remove HTML attributes if components are not present.
|
|
6
|
-
|
|
7
|
-
## 3.0.3
|
|
8
|
-
|
|
9
|
-
### bug fix
|
|
10
|
-
* Fix XSS vulnerability on error components.
|
|
11
|
-
|
|
12
|
-
## 3.0.2
|
|
13
|
-
|
|
14
|
-
### enhancements
|
|
15
|
-
|
|
16
|
-
* Support Rails 4.1
|
|
17
|
-
|
|
18
|
-
## 3.0.1
|
|
19
|
-
|
|
20
|
-
### bug fix
|
|
21
|
-
* Fix XSS vulnerability on label, hint and error components.
|
|
22
|
-
|
|
23
|
-
## 3.0.0
|
|
1
|
+
## 3.1.0
|
|
24
2
|
|
|
25
3
|
### enhancements
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
29
|
-
*
|
|
30
|
-
*
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
|
|
36
|
-
*
|
|
4
|
+
* Update foundation generator to version 5. [@jorge-d](https://github.com/jorge-d)
|
|
5
|
+
* Add mapping to `uuid` columns.
|
|
6
|
+
* Add custom namespaces for custom inputs feature. [@vala](https://github.com/vala)
|
|
7
|
+
* Add `:unless_blank` option to the wrapper API. [@IanVaughan](https://github.com/IanVaughan)
|
|
8
|
+
* Add support to html markup in the I18n options. [@laurocaetano](https://github.com/laurocaetano)
|
|
9
|
+
* Add the `full_error` component. [@laurocaetano](https://github.com/laurocaetano)
|
|
10
|
+
* Add support to `scope` to be used on associations. [@laurocaetano](https://github.com/laurocaetano)
|
|
11
|
+
* Execute the association `condition` in the object context. [@laurocaetano](https://github.com/laurocaetano)
|
|
12
|
+
* Check if the given association responds to `order` before calling it. [@laurocaetano](https://github.com/laurocaetano)
|
|
13
|
+
* Add Bootstrap 3 initializer template.
|
|
14
|
+
* For radio or checkbox collection always use `:item_wrapper_tag` to wrap the content and add `label` when using `boolean_style` with `:nested` [@kassio](https://github.com/kassio) and [@erichkist](https://github.com/erichkist)
|
|
15
|
+
* `input_field` uses the same wrapper as input but only with attribute components. [@nashby](https://github.com/nashby)
|
|
16
|
+
* Add wrapper mapping per form basis [@rcillo](https://github.com/rcillo) and [@bernardoamc](https://github.com/bernardoamc)
|
|
17
|
+
* Add `for` attribute to `label` when collections are rendered as radio or checkbox [@erichkist](https://github.com/erichkist), [@ulissesalmeida](https://github.com/ulissesalmeida) and [@fabioyamate](https://github.com/fabioyamate)
|
|
18
|
+
* Add `include_default_input_wrapper_class` config [@luizcosta](https://github.com/luizcosta)
|
|
19
|
+
* Map `datetime`, `date` and `time` input types to their respective HTML5 input tags
|
|
20
|
+
when the `:html5` is set to `true` [@volmer](https://github.com/volmer)
|
|
21
|
+
* Add `boolean_label_class` config.
|
|
22
|
+
* Add `:html` option to include additional attributes on custom wrappers [@remofritzsche](https://github.com/remofritzsche) and [@ulissesalmeida](https://github.com/ulissesalmeida)
|
|
23
|
+
* Make possible to use the Wrappers API to define attributes for the components.
|
|
24
|
+
See https://github.com/plataformatec/simple_form/pull/997 for more information.
|
|
25
|
+
* Put a whitespace before the `inline_label` options of boolean input if it is present.
|
|
26
|
+
* Add support to configure the `label_text` proc at the wrapper level. [@NOX73](https://github.com/NOX73)
|
|
27
|
+
* `label_text` proc now receive three arguments (label, request, and if the label was explicit). [@timscott](https://github.com/timscott)
|
|
28
|
+
* Add I18n support to `:include_blank` and `:prompt` when `:translate` is used as value. [@haines](https://github.com/plataformatec/simple_form/pull/616)
|
|
29
|
+
* Add support to define custom error messages for the attributes.
|
|
30
|
+
* Add support to change the I18n scope to be used in Simple Form. [@nielsbuus](https://github.com/nielsbuus)
|
|
31
|
+
* The default form class can now be overridden with `html: { :class }`. [@rmm5t](https://github.com/rmm5t)
|
|
37
32
|
|
|
38
33
|
### bug fix
|
|
39
|
-
*
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
*
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
*
|
|
48
|
-
|
|
49
|
-
|
|
34
|
+
* Fix `full_error` when the attribute is an association. [@mvdamme](https://github.com/jorge-d)
|
|
35
|
+
* Fix suppport to `:namespace` and `:index` options for nested check boxes and radio buttons when the attribute is an association.
|
|
36
|
+
* Collection input that uses automatic collection translation properly sets checked values.
|
|
37
|
+
Closes [#971](https://github.com/plataformatec/simple_form/issues/971) [@nashby](https://github.com/nashby)
|
|
38
|
+
* Collection input generates `required` attribute if it has `prompt` option. [@nashby](https://github.com/nashby)
|
|
39
|
+
* Grouped collection uses the first non-empty object to detect label and value methods.
|
|
40
|
+
|
|
41
|
+
## deprecation
|
|
42
|
+
* Methods on custom inputs now accept a required argument with the wrapper options.
|
|
43
|
+
See https://github.com/plataformatec/simple_form/pull/997 for more information.
|
|
44
|
+
* SimpleForm.form_class is deprecated in favor of SimpleForm.default_form_class.
|
|
45
|
+
Future versions of Simple Form will not generate `simple_form` class for the form
|
|
46
|
+
element.
|
|
47
|
+
See https://github.com/plataformatec/simple_form/pull/1109 for more information.
|
|
48
|
+
|
|
49
|
+
Please check [v3.0](https://github.com/plataformatec/simple_form/blob/v3.0/CHANGELOG.md) for previous changes.
|
data/MIT-LICENSE
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
Copyright (c) 2009-
|
|
1
|
+
Copyright (c) 2009-2014 Plataformatec http://plataformatec.com.br/
|
|
2
2
|
|
|
3
3
|
Permission is hereby granted, free of charge, to any person obtaining
|
|
4
4
|
a copy of this software and associated documentation files (the
|