simple_form 5.0.1 → 5.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/CHANGELOG.md +17 -7
- data/MIT-LICENSE +2 -1
- data/README.md +20 -30
- data/lib/generators/simple_form/templates/README +2 -3
- data/lib/generators/simple_form/templates/config/initializers/simple_form.rb +1 -1
- data/lib/generators/simple_form/templates/config/initializers/simple_form_bootstrap.rb +2 -2
- data/lib/generators/simple_form/templates/config/initializers/simple_form_foundation.rb +1 -1
- data/lib/simple_form.rb +1 -1
- data/lib/simple_form/form_builder.rb +1 -0
- data/lib/simple_form/inputs.rb +1 -0
- data/lib/simple_form/inputs/collection_check_boxes_input.rb +1 -1
- data/lib/simple_form/inputs/collection_input.rb +1 -1
- data/lib/simple_form/inputs/rich_text_area_input.rb +12 -0
- data/lib/simple_form/version.rb +1 -1
- data/lib/simple_form/wrappers/root.rb +8 -3
- data/test/form_builder/label_test.rb +1 -1
- data/test/form_builder/wrapper_test.rb +7 -0
- data/test/inputs/collection_select_input_test.rb +6 -0
- data/test/inputs/rich_text_area_input_test.rb +15 -0
- data/test/support/misc_helpers.rb +2 -2
- data/test/test_helper.rb +1 -1
- metadata +38 -35
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: a0bc629634439c07aaad7a623c7d98f38debf0a17883f97b50f016ee82ea30e1
|
4
|
+
data.tar.gz: 2e5a8780c50af021b99c5e6a3192c0c86a127feee31f8548871d9a1f89007b86
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 84f39f8d9a582bb53bd58ef7b913a13e581596dc70cb6d5503c6215059e59ca0498411d038dcd6f4e497e97aa3ad8b8d769b3fc27ef872a1f5065288453895de
|
7
|
+
data.tar.gz: 19ba331b70a5fa0dbabf818c13b79abd432c14cc7216077d3fd49f6801047f32c5a52b4513ef49a57b1356383f3dd8fbffb56dcceba8018abb02db577ab27877
|
data/CHANGELOG.md
CHANGED
@@ -1,5 +1,15 @@
|
|
1
1
|
## Unreleased
|
2
2
|
|
3
|
+
## 5.0.2
|
4
|
+
|
5
|
+
### Enhancements
|
6
|
+
* Remove instruction to use form-inline class. [@goalaleo](https://github.com/goalaleo)
|
7
|
+
* Added RichTextAreaInput for ActionText. [itsterry](https://github.com/itsterry)
|
8
|
+
* Skip valid_class check if no class defined. [TALlama](https://github.com/TALlama)
|
9
|
+
|
10
|
+
### Bug fix
|
11
|
+
* Fix 'aria-required' field generated by prompt. [@CarlosAlbertoSantos](https://github.com/CarlosAlbertoSantos)
|
12
|
+
|
3
13
|
## 5.0.1
|
4
14
|
|
5
15
|
### Bug fix
|
@@ -112,7 +122,7 @@ See http://blog.plataformatec.com.br/2019/09/incorrect-access-control-in-simple-
|
|
112
122
|
|
113
123
|
### bug fix
|
114
124
|
* Fix `merge_wrapper_options` to correctly merge options with duplicated keys. [@herminiotorres](https://github.com/herminiotorres)
|
115
|
-
Closes [#1278](https://github.com/
|
125
|
+
Closes [#1278](https://github.com/heartcombo/simple_form/issues/1278).
|
116
126
|
|
117
127
|
## 3.2.1
|
118
128
|
|
@@ -174,11 +184,11 @@ See http://blog.plataformatec.com.br/2019/09/incorrect-access-control-in-simple-
|
|
174
184
|
* Add `boolean_label_class` config.
|
175
185
|
* Add `:html` option to include additional attributes on custom wrappers [@remofritzsche](https://github.com/remofritzsche) and [@ulissesalmeida](https://github.com/ulissesalmeida)
|
176
186
|
* Make possible to use the Wrappers API to define attributes for the components.
|
177
|
-
See https://github.com/
|
187
|
+
See https://github.com/heartcombo/simple_form/pull/997 for more information.
|
178
188
|
* Put a whitespace before the `inline_label` options of boolean input if it is present.
|
179
189
|
* Add support to configure the `label_text` proc at the wrapper level. [@NOX73](https://github.com/NOX73)
|
180
190
|
* `label_text` proc now receive three arguments (label, request, and if the label was explicit). [@timscott](https://github.com/timscott)
|
181
|
-
* Add I18n support to `:include_blank` and `:prompt` when `:translate` is used as value. [@haines](https://github.com/
|
191
|
+
* Add I18n support to `:include_blank` and `:prompt` when `:translate` is used as value. [@haines](https://github.com/heartcombo/simple_form/pull/616)
|
182
192
|
* Add support to define custom error messages for the attributes.
|
183
193
|
* Add support to change the I18n scope to be used in Simple Form. [@nielsbuus](https://github.com/nielsbuus)
|
184
194
|
* The default form class can now be overridden with `html: { :class }`. [@rmm5t](https://github.com/rmm5t)
|
@@ -187,16 +197,16 @@ See http://blog.plataformatec.com.br/2019/09/incorrect-access-control-in-simple-
|
|
187
197
|
* Fix `full_error` when the attribute is an association. [@mvdamme](https://github.com/jorge-d)
|
188
198
|
* Fix suppport to `:namespace` and `:index` options for nested check boxes and radio buttons when the attribute is an association.
|
189
199
|
* Collection input that uses automatic collection translation properly sets checked values.
|
190
|
-
Closes [#971](https://github.com/
|
200
|
+
Closes [#971](https://github.com/heartcombo/simple_form/issues/971) [@nashby](https://github.com/nashby)
|
191
201
|
* Collection input generates `required` attribute if it has `prompt` option. [@nashby](https://github.com/nashby)
|
192
202
|
* Grouped collection uses the first non-empty object to detect label and value methods.
|
193
203
|
|
194
204
|
## deprecation
|
195
205
|
* Methods on custom inputs now accept a required argument with the wrapper options.
|
196
|
-
See https://github.com/
|
206
|
+
See https://github.com/heartcombo/simple_form/pull/997 for more information.
|
197
207
|
* SimpleForm.form_class is deprecated in favor of SimpleForm.default_form_class.
|
198
208
|
Future versions of Simple Form will not generate `simple_form` class for the form
|
199
209
|
element.
|
200
|
-
See https://github.com/
|
210
|
+
See https://github.com/heartcombo/simple_form/pull/1109 for more information.
|
201
211
|
|
202
|
-
Please check [v3.0](https://github.com/
|
212
|
+
Please check [v3.0](https://github.com/heartcombo/simple_form/blob/v3.0/CHANGELOG.md) for previous changes.
|
data/MIT-LICENSE
CHANGED
@@ -1,4 +1,5 @@
|
|
1
|
-
Copyright (c)
|
1
|
+
Copyright (c) 2020 Rafael França, Carlos Antônio da Silva
|
2
|
+
Copyright (c) 2009-2019 Plataformatec
|
2
3
|
|
3
4
|
Permission is hereby granted, free of charge, to any person obtaining
|
4
5
|
a copy of this software and associated documentation files (the
|
data/README.md
CHANGED
@@ -1,6 +1,4 @@
|
|
1
|
-
![Simple Form Logo](https://raw.github.com/
|
2
|
-
|
3
|
-
By [Plataformatec](http://plataformatec.com.br/).
|
1
|
+
![Simple Form Logo](https://raw.github.com/heartcombo/simple_form/master/simple_form.png)
|
4
2
|
|
5
3
|
Rails forms made easy.
|
6
4
|
|
@@ -9,8 +7,7 @@ your forms. The basic goal of **Simple Form** is to not touch your way of defini
|
|
9
7
|
you find the better design for your eyes. Most of the DSL was inherited from Formtastic,
|
10
8
|
which we are thankful for and should make you feel right at home.
|
11
9
|
|
12
|
-
INFO: This README
|
13
|
-
and refers to **Simple Form** 3.1. For older releases, check the related branch for your version.
|
10
|
+
INFO: This README refers to **Simple Form** 3.1. For older releases, check the related branch for your version.
|
14
11
|
|
15
12
|
## Installation
|
16
13
|
|
@@ -184,7 +181,7 @@ By default, **Simple Form** will look at the column type in the database and use
|
|
184
181
|
appropriate input for the column. For example, a column created with type
|
185
182
|
`:text` in the database will use a `textarea` input by default. See the section
|
186
183
|
[Available input types and defaults for each column
|
187
|
-
type](https://github.com/
|
184
|
+
type](https://github.com/heartcombo/simple_form#available-input-types-and-defaults-for-each-column-type)
|
188
185
|
for a complete list of defaults.
|
189
186
|
|
190
187
|
**Simple Form** also lets you overwrite the default input type it creates:
|
@@ -288,7 +285,7 @@ end
|
|
288
285
|
</form>
|
289
286
|
```
|
290
287
|
|
291
|
-
To view the actual RDocs for this, check them out here - http://rubydoc.info/github/
|
288
|
+
To view the actual RDocs for this, check them out here - http://rubydoc.info/github/heartcombo/simple_form/master/SimpleForm/FormBuilder:input_field
|
292
289
|
|
293
290
|
### Collections
|
294
291
|
|
@@ -318,7 +315,7 @@ Collection inputs accept two other options beside collections:
|
|
318
315
|
Those methods are useful to manipulate the given collection. Both of these options also accept
|
319
316
|
lambda/procs in case you want to calculate the value or label in a special way eg. custom
|
320
317
|
translation. You can also define a `to_label` method on your model as **Simple Form** will search for
|
321
|
-
and use `:to_label` as a `:label_method` first if it is found.
|
318
|
+
and use `:to_label` as a `:label_method` first if it is found.
|
322
319
|
|
323
320
|
By default, **Simple Form** will use the first item from an array as the label and the second one as the value.
|
324
321
|
If you want to change this behavior you must make it explicit, like this:
|
@@ -561,6 +558,7 @@ Mapping | Generated HTML Element | Database Column Type
|
|
561
558
|
`password` | `input[type=password]` | `string` with `name =~ /password/`
|
562
559
|
`search` | `input[type=search]` | -
|
563
560
|
`uuid` | `input[type=text]` | `uuid`
|
561
|
+
`color` | `input[type=color]` | `string`
|
564
562
|
`text` | `textarea` | `text`
|
565
563
|
`hstore` | `textarea` | `hstore`
|
566
564
|
`json` | `textarea` | `json`
|
@@ -991,7 +989,7 @@ when the content is present.
|
|
991
989
|
|
992
990
|
## Custom Components
|
993
991
|
|
994
|
-
When you use custom wrappers, you might also be looking for a way to add custom components to your
|
992
|
+
When you use custom wrappers, you might also be looking for a way to add custom components to your
|
995
993
|
wrapper. The default components are:
|
996
994
|
|
997
995
|
```ruby
|
@@ -1142,7 +1140,7 @@ by passing the html5 option:
|
|
1142
1140
|
|
1143
1141
|
### Using non Active Record objects
|
1144
1142
|
|
1145
|
-
There are few ways to build forms with objects that don't inherit from Active Record, as
|
1143
|
+
There are few ways to build forms with objects that don't inherit from Active Record, as
|
1146
1144
|
follows:
|
1147
1145
|
|
1148
1146
|
You can include the module `ActiveModel::Model`.
|
@@ -1155,7 +1153,7 @@ class User
|
|
1155
1153
|
end
|
1156
1154
|
```
|
1157
1155
|
|
1158
|
-
If you are using Presenters or Decorators that inherit from `SimpleDelegator` you can delegate
|
1156
|
+
If you are using Presenters or Decorators that inherit from `SimpleDelegator` you can delegate
|
1159
1157
|
it to the model.
|
1160
1158
|
|
1161
1159
|
```ruby
|
@@ -1189,7 +1187,7 @@ class User
|
|
1189
1187
|
end
|
1190
1188
|
```
|
1191
1189
|
|
1192
|
-
If your object doesn't implement those methods, you must make explicit it when you are
|
1190
|
+
If your object doesn't implement those methods, you must make explicit it when you are
|
1193
1191
|
building the form
|
1194
1192
|
|
1195
1193
|
```ruby
|
@@ -1212,18 +1210,11 @@ end
|
|
1212
1210
|
|
1213
1211
|
## Information
|
1214
1212
|
|
1215
|
-
### Google Group
|
1216
|
-
|
1217
|
-
If you have any questions, comments, or concerns please use the Google Group instead of the GitHub
|
1218
|
-
Issues tracker:
|
1219
|
-
|
1220
|
-
http://groups.google.com/group/plataformatec-simpleform
|
1221
|
-
|
1222
1213
|
### RDocs
|
1223
1214
|
|
1224
1215
|
You can view the **Simple Form** documentation in RDoc format here:
|
1225
1216
|
|
1226
|
-
http://rubydoc.info/github/
|
1217
|
+
http://rubydoc.info/github/heartcombo/simple_form/master/frames
|
1227
1218
|
|
1228
1219
|
### Bug reports
|
1229
1220
|
|
@@ -1231,25 +1222,24 @@ If you discover any bugs, feel free to create an issue on GitHub. Please add as
|
|
1231
1222
|
possible to help us in fixing the potential bug. We also encourage you to help even more by forking and
|
1232
1223
|
sending us a pull request.
|
1233
1224
|
|
1234
|
-
https://github.com/
|
1225
|
+
https://github.com/heartcombo/simple_form/issues
|
1235
1226
|
|
1236
|
-
If you have discovered a security related bug, please do NOT use the GitHub issue tracker. Send an e-mail to
|
1227
|
+
If you have discovered a security related bug, please do NOT use the GitHub issue tracker. Send an e-mail to heartcombo@googlegroups.com.
|
1237
1228
|
|
1238
1229
|
## Maintainers
|
1239
1230
|
|
1240
|
-
* José Valim (https://github.com/josevalim)
|
1241
1231
|
* Carlos Antonio da Silva (https://github.com/carlosantoniodasilva)
|
1242
1232
|
* Rafael Mendonça França (https://github.com/rafaelfranca)
|
1243
|
-
*
|
1233
|
+
* Felipe Renan (https://github.com/feliperenan)
|
1244
1234
|
|
1245
1235
|
[![Gem Version](https://fury-badge.herokuapp.com/rb/simple_form.png)](http://badge.fury.io/rb/simple_form)
|
1246
|
-
[![Build Status](https://api.travis-ci.org/
|
1247
|
-
[![Code Climate](https://codeclimate.com/github/
|
1248
|
-
[![Inline docs](http://inch-ci.org/github/
|
1236
|
+
[![Build Status](https://api.travis-ci.org/heartcombo/simple_form.svg?branch=master)](http://travis-ci.org/heartcombo/simple_form)
|
1237
|
+
[![Code Climate](https://codeclimate.com/github/heartcombo/simple_form.png)](https://codeclimate.com/github/heartcombo/simple_form)
|
1238
|
+
[![Inline docs](http://inch-ci.org/github/heartcombo/simple_form.png)](http://inch-ci.org/github/heartcombo/simple_form)
|
1249
1239
|
|
1250
1240
|
## License
|
1251
1241
|
|
1252
|
-
MIT License. Copyright 2009-2019 Plataformatec.
|
1242
|
+
MIT License. Copyright 2020 Rafael França, Carlos Antônio da Silva. Copyright 2009-2019 Plataformatec.
|
1243
|
+
|
1244
|
+
The Simple Form logo is licensed under [Creative Commons Attribution-NonCommercial-NoDerivatives 4.0 International License](https://creativecommons.org/licenses/by-nc-nd/4.0/).
|
1253
1245
|
|
1254
|
-
You are not granted rights or licenses to the trademarks of the Plataformatec, including without
|
1255
|
-
limitation the Simple Form name or logo.
|
@@ -3,9 +3,8 @@
|
|
3
3
|
Be sure to have a copy of the Bootstrap stylesheet available on your
|
4
4
|
application, you can get it on http://getbootstrap.com/.
|
5
5
|
|
6
|
-
|
7
|
-
class, '.form-inline', as the following:
|
6
|
+
For usage examples and documentation, see:
|
8
7
|
|
9
|
-
|
8
|
+
http://simple-form-bootstrap.plataformatec.com.br/
|
10
9
|
|
11
10
|
===============================================================================
|
@@ -2,7 +2,7 @@
|
|
2
2
|
#
|
3
3
|
# Uncomment this and change the path if necessary to include your own
|
4
4
|
# components.
|
5
|
-
# See https://github.com/
|
5
|
+
# See https://github.com/heartcombo/simple_form#custom-components to know
|
6
6
|
# more about custom components.
|
7
7
|
# Dir[Rails.root.join('lib/components/**/*.rb')].each { |f| require f }
|
8
8
|
#
|
@@ -4,11 +4,11 @@
|
|
4
4
|
# This generator is maintained by the community around simple_form-bootstrap:
|
5
5
|
# https://github.com/rafaelfranca/simple_form-bootstrap
|
6
6
|
# All future development, tests, and organization should happen there.
|
7
|
-
# Background history: https://github.com/
|
7
|
+
# Background history: https://github.com/heartcombo/simple_form/issues/1561
|
8
8
|
|
9
9
|
# Uncomment this and change the path if necessary to include your own
|
10
10
|
# components.
|
11
|
-
# See https://github.com/
|
11
|
+
# See https://github.com/heartcombo/simple_form#custom-components
|
12
12
|
# to know more about custom components.
|
13
13
|
# Dir[Rails.root.join('lib/components/**/*.rb')].each { |f| require f }
|
14
14
|
|
@@ -2,7 +2,7 @@
|
|
2
2
|
#
|
3
3
|
# Uncomment this and change the path if necessary to include your own
|
4
4
|
# components.
|
5
|
-
# See https://github.com/
|
5
|
+
# See https://github.com/heartcombo/simple_form#custom-components to know
|
6
6
|
# more about custom components.
|
7
7
|
# Dir[Rails.root.join('lib/components/**/*.rb')].each { |f| require f }
|
8
8
|
#
|
data/lib/simple_form.rb
CHANGED
@@ -26,6 +26,7 @@ module SimpleForm
|
|
26
26
|
map_type :range, to: SimpleForm::Inputs::RangeInput
|
27
27
|
map_type :check_boxes, to: SimpleForm::Inputs::CollectionCheckBoxesInput
|
28
28
|
map_type :radio_buttons, to: SimpleForm::Inputs::CollectionRadioButtonsInput
|
29
|
+
map_type :rich_text_area, to: SimpleForm::Inputs::RichTextAreaInput
|
29
30
|
map_type :select, to: SimpleForm::Inputs::CollectionSelectInput
|
30
31
|
map_type :grouped_select, to: SimpleForm::Inputs::GroupedCollectionSelectInput
|
31
32
|
map_type :date, :time, :datetime, to: SimpleForm::Inputs::DateTimeInput
|
data/lib/simple_form/inputs.rb
CHANGED
@@ -5,7 +5,7 @@ module SimpleForm
|
|
5
5
|
protected
|
6
6
|
|
7
7
|
# Checkbox components do not use the required html tag.
|
8
|
-
# More info: https://github.com/
|
8
|
+
# More info: https://github.com/heartcombo/simple_form/issues/340#issuecomment-2871956
|
9
9
|
def has_required?
|
10
10
|
false
|
11
11
|
end
|
@@ -41,7 +41,7 @@ module SimpleForm
|
|
41
41
|
end
|
42
42
|
|
43
43
|
def has_required?
|
44
|
-
super && (input_options[:include_blank] || input_options[:prompt] || multiple?)
|
44
|
+
super && (input_options[:include_blank] || input_options[:prompt].present? || multiple?)
|
45
45
|
end
|
46
46
|
|
47
47
|
# Check if :include_blank must be included by default.
|
@@ -0,0 +1,12 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
module SimpleForm
|
3
|
+
module Inputs
|
4
|
+
class RichTextAreaInput < Base
|
5
|
+
def input(wrapper_options = nil)
|
6
|
+
merged_input_options = merge_wrapper_options(input_html_options, wrapper_options)
|
7
|
+
|
8
|
+
@builder.rich_text_area(attribute_name, merged_input_options)
|
9
|
+
end
|
10
|
+
end
|
11
|
+
end
|
12
|
+
end
|
data/lib/simple_form/version.rb
CHANGED
@@ -28,11 +28,16 @@ module SimpleForm
|
|
28
28
|
css += SimpleForm.additional_classes_for(:wrapper) do
|
29
29
|
input.additional_classes + [input.input_class]
|
30
30
|
end
|
31
|
-
css << (
|
32
|
-
css << (
|
33
|
-
css << (
|
31
|
+
css << html_class(:error_class, options) { input.has_errors? }
|
32
|
+
css << html_class(:hint_class, options) { input.has_hint? }
|
33
|
+
css << html_class(:valid_class, options) { input.valid? }
|
34
34
|
css.compact
|
35
35
|
end
|
36
|
+
|
37
|
+
def html_class(key, options)
|
38
|
+
css = (options[:"wrapper_#{key}"] || @defaults[key])
|
39
|
+
css if css && yield
|
40
|
+
end
|
36
41
|
end
|
37
42
|
end
|
38
43
|
end
|
@@ -19,7 +19,7 @@ class LabelTest < ActionView::TestCase
|
|
19
19
|
assert_select 'label.string[for=user_name]', /Name/
|
20
20
|
end
|
21
21
|
|
22
|
-
test 'builder generates a label for the boolean
|
22
|
+
test 'builder generates a label for the boolean attribute' do
|
23
23
|
with_label_for @user, :name, as: :boolean
|
24
24
|
assert_select 'label.boolean[for=user_name]', /Name/
|
25
25
|
assert_no_select 'label[as=boolean]'
|
@@ -59,6 +59,13 @@ class WrapperTest < ActionView::TestCase
|
|
59
59
|
assert_no_select 'input.is-invalid'
|
60
60
|
end
|
61
61
|
|
62
|
+
test 'wrapper does not determine if valid class is needed when it is set to nil' do
|
63
|
+
@user.instance_eval { undef errors }
|
64
|
+
with_form_for @user, :name, wrapper: custom_wrapper_with_input_valid_class(valid_class: nil)
|
65
|
+
|
66
|
+
assert_no_select 'div.field_without_errors'
|
67
|
+
end
|
68
|
+
|
62
69
|
test 'wrapper adds hint class for attribute with a hint' do
|
63
70
|
with_form_for @user, :name, hint: 'hint'
|
64
71
|
assert_select 'div.field_with_hint'
|
@@ -284,6 +284,12 @@ class CollectionSelectInputTest < ActionView::TestCase
|
|
284
284
|
assert_select 'select[required]'
|
285
285
|
end
|
286
286
|
|
287
|
+
test "collection input generated aria-label should contain 'true'" do
|
288
|
+
with_input_for @user, :age, :select, collection: 18..30, prompt: "Please select foo"
|
289
|
+
assert_select 'select.required'
|
290
|
+
assert_select 'select[aria-required=true]'
|
291
|
+
end
|
292
|
+
|
287
293
|
test 'collection input with select type does not generate required html attribute without blank option' do
|
288
294
|
with_input_for @user, :name, :select, include_blank: false, collection: %w[Jose Carlos]
|
289
295
|
assert_select 'select.required'
|
@@ -0,0 +1,15 @@
|
|
1
|
+
# frozen_string_literal: true
|
2
|
+
# encoding: UTF-8
|
3
|
+
require 'test_helper'
|
4
|
+
|
5
|
+
class RichTextAreaInputTest < ActionView::TestCase
|
6
|
+
test 'input generates a text area for text attributes' do
|
7
|
+
with_input_for @user, :description, :text
|
8
|
+
assert_select 'textarea.text#user_description'
|
9
|
+
end
|
10
|
+
|
11
|
+
test 'input generates a text area for text attributes that accept placeholder' do
|
12
|
+
with_input_for @user, :description, :text, placeholder: 'Put in some text'
|
13
|
+
assert_select 'textarea.text[placeholder="Put in some text"]'
|
14
|
+
end
|
15
|
+
end
|
@@ -213,8 +213,8 @@ module MiscHelpers
|
|
213
213
|
end
|
214
214
|
end
|
215
215
|
|
216
|
-
def custom_wrapper_with_input_valid_class
|
217
|
-
SimpleForm.build tag: :div, class: "custom_wrapper", valid_class:
|
216
|
+
def custom_wrapper_with_input_valid_class(valid_class: :field_without_errors)
|
217
|
+
SimpleForm.build tag: :div, class: "custom_wrapper", valid_class: valid_class do |b|
|
218
218
|
b.use :label
|
219
219
|
b.use :input, class: 'inline-class', valid_class: 'is-valid'
|
220
220
|
end
|
data/test/test_helper.rb
CHANGED
@@ -60,7 +60,7 @@ class ActionView::TestCase
|
|
60
60
|
|
61
61
|
@validating_user = ValidatingUser.build({
|
62
62
|
name: 'Tester McTesterson',
|
63
|
-
description: 'A test user of the most
|
63
|
+
description: 'A test user of the most distinguished caliber',
|
64
64
|
home_picture: 'Home picture',
|
65
65
|
age: 19,
|
66
66
|
amount: 15,
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_form
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 5.0.
|
4
|
+
version: 5.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- José Valim
|
@@ -10,7 +10,7 @@ authors:
|
|
10
10
|
autorequire:
|
11
11
|
bindir: bin
|
12
12
|
cert_chain: []
|
13
|
-
date:
|
13
|
+
date: 2020-02-06 00:00:00.000000000 Z
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|
16
16
|
name: activemodel
|
@@ -41,7 +41,7 @@ dependencies:
|
|
41
41
|
- !ruby/object:Gem::Version
|
42
42
|
version: '5.0'
|
43
43
|
description: Forms made easy!
|
44
|
-
email:
|
44
|
+
email: heartcombo@googlegroups.com
|
45
45
|
executables: []
|
46
46
|
extensions: []
|
47
47
|
extra_rdoc_files: []
|
@@ -100,6 +100,7 @@ files:
|
|
100
100
|
- lib/simple_form/inputs/password_input.rb
|
101
101
|
- lib/simple_form/inputs/priority_input.rb
|
102
102
|
- lib/simple_form/inputs/range_input.rb
|
103
|
+
- lib/simple_form/inputs/rich_text_area_input.rb
|
103
104
|
- lib/simple_form/inputs/string_input.rb
|
104
105
|
- lib/simple_form/inputs/text_input.rb
|
105
106
|
- lib/simple_form/map_type.rb
|
@@ -142,6 +143,7 @@ files:
|
|
142
143
|
- test/inputs/priority_input_test.rb
|
143
144
|
- test/inputs/readonly_test.rb
|
144
145
|
- test/inputs/required_test.rb
|
146
|
+
- test/inputs/rich_text_area_input_test.rb
|
145
147
|
- test/inputs/string_input_test.rb
|
146
148
|
- test/inputs/text_input_test.rb
|
147
149
|
- test/simple_form_test.rb
|
@@ -150,7 +152,7 @@ files:
|
|
150
152
|
- test/support/mock_controller.rb
|
151
153
|
- test/support/models.rb
|
152
154
|
- test/test_helper.rb
|
153
|
-
homepage: https://github.com/
|
155
|
+
homepage: https://github.com/heartcombo/simple_form
|
154
156
|
licenses:
|
155
157
|
- MIT
|
156
158
|
metadata: {}
|
@@ -169,46 +171,47 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
169
171
|
- !ruby/object:Gem::Version
|
170
172
|
version: '0'
|
171
173
|
requirements: []
|
172
|
-
rubygems_version: 3.0.
|
174
|
+
rubygems_version: 3.0.3
|
173
175
|
signing_key:
|
174
176
|
specification_version: 4
|
175
177
|
summary: Forms made easy!
|
176
178
|
test_files:
|
177
|
-
- test/
|
178
|
-
- test/components/custom_components_test.rb
|
179
|
+
- test/support/mock_controller.rb
|
179
180
|
- test/support/discovery_inputs.rb
|
180
181
|
- test/support/misc_helpers.rb
|
181
|
-
- test/support/mock_controller.rb
|
182
182
|
- test/support/models.rb
|
183
|
-
- test/
|
184
|
-
- test/form_builder/error_test.rb
|
185
|
-
- test/form_builder/hint_test.rb
|
186
|
-
- test/form_builder/error_notification_test.rb
|
187
|
-
- test/form_builder/general_test.rb
|
188
|
-
- test/form_builder/button_test.rb
|
189
|
-
- test/form_builder/input_field_test.rb
|
190
|
-
- test/form_builder/label_test.rb
|
191
|
-
- test/form_builder/wrapper_test.rb
|
192
|
-
- test/form_builder/association_test.rb
|
193
|
-
- test/generators/simple_form_generator_test.rb
|
194
|
-
- test/action_view_extensions/builder_test.rb
|
195
|
-
- test/action_view_extensions/form_helper_test.rb
|
196
|
-
- test/simple_form_test.rb
|
197
|
-
- test/inputs/string_input_test.rb
|
198
|
-
- test/inputs/numeric_input_test.rb
|
199
|
-
- test/inputs/readonly_test.rb
|
200
|
-
- test/inputs/grouped_collection_select_input_test.rb
|
201
|
-
- test/inputs/text_input_test.rb
|
202
|
-
- test/inputs/collection_check_boxes_input_test.rb
|
203
|
-
- test/inputs/boolean_input_test.rb
|
204
|
-
- test/inputs/disabled_test.rb
|
205
|
-
- test/inputs/discovery_test.rb
|
183
|
+
- test/inputs/hidden_input_test.rb
|
206
184
|
- test/inputs/collection_select_input_test.rb
|
185
|
+
- test/inputs/priority_input_test.rb
|
207
186
|
- test/inputs/general_test.rb
|
208
|
-
- test/inputs/
|
187
|
+
- test/inputs/text_input_test.rb
|
188
|
+
- test/inputs/boolean_input_test.rb
|
189
|
+
- test/inputs/grouped_collection_select_input_test.rb
|
209
190
|
- test/inputs/required_test.rb
|
191
|
+
- test/inputs/disabled_test.rb
|
210
192
|
- test/inputs/collection_radio_buttons_input_test.rb
|
211
|
-
- test/inputs/
|
212
|
-
- test/inputs/
|
213
|
-
- test/inputs/
|
193
|
+
- test/inputs/collection_check_boxes_input_test.rb
|
194
|
+
- test/inputs/color_input_test.rb
|
195
|
+
- test/inputs/numeric_input_test.rb
|
196
|
+
- test/inputs/string_input_test.rb
|
214
197
|
- test/inputs/datetime_input_test.rb
|
198
|
+
- test/inputs/rich_text_area_input_test.rb
|
199
|
+
- test/inputs/readonly_test.rb
|
200
|
+
- test/inputs/discovery_test.rb
|
201
|
+
- test/inputs/file_input_test.rb
|
202
|
+
- test/generators/simple_form_generator_test.rb
|
203
|
+
- test/form_builder/general_test.rb
|
204
|
+
- test/form_builder/button_test.rb
|
205
|
+
- test/form_builder/error_test.rb
|
206
|
+
- test/form_builder/label_test.rb
|
207
|
+
- test/form_builder/association_test.rb
|
208
|
+
- test/form_builder/error_notification_test.rb
|
209
|
+
- test/form_builder/wrapper_test.rb
|
210
|
+
- test/form_builder/input_field_test.rb
|
211
|
+
- test/form_builder/hint_test.rb
|
212
|
+
- test/simple_form_test.rb
|
213
|
+
- test/test_helper.rb
|
214
|
+
- test/action_view_extensions/form_helper_test.rb
|
215
|
+
- test/action_view_extensions/builder_test.rb
|
216
|
+
- test/components/label_test.rb
|
217
|
+
- test/components/custom_components_test.rb
|