simple_form 3.0.1 → 4.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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +149 -25
- data/MIT-LICENSE +1 -1
- data/README.md +441 -107
- data/lib/generators/simple_form/install_generator.rb +4 -3
- data/lib/generators/simple_form/templates/README +4 -5
- data/lib/generators/simple_form/templates/_form.html.erb +2 -0
- data/lib/generators/simple_form/templates/_form.html.haml +2 -0
- data/lib/generators/simple_form/templates/_form.html.slim +1 -0
- data/lib/generators/simple_form/templates/config/initializers/simple_form.rb +48 -11
- data/lib/generators/simple_form/templates/config/initializers/simple_form_bootstrap.rb +417 -23
- data/lib/generators/simple_form/templates/config/initializers/simple_form_foundation.rb +101 -5
- data/lib/generators/simple_form/templates/config/locales/simple_form.en.yml +7 -2
- data/lib/simple_form/action_view_extensions/builder.rb +2 -0
- data/lib/simple_form/action_view_extensions/form_helper.rb +10 -3
- data/lib/simple_form/components/errors.rb +38 -3
- data/lib/simple_form/components/hints.rb +3 -2
- data/lib/simple_form/components/html5.rb +16 -5
- data/lib/simple_form/components/label_input.rb +21 -2
- data/lib/simple_form/components/labels.rb +22 -11
- data/lib/simple_form/components/maxlength.rb +9 -5
- data/lib/simple_form/components/min_max.rb +2 -1
- data/lib/simple_form/components/minlength.rb +38 -0
- data/lib/simple_form/components/pattern.rb +2 -1
- data/lib/simple_form/components/placeholders.rb +4 -3
- data/lib/simple_form/components/readonly.rb +2 -1
- data/lib/simple_form/components.rb +2 -0
- data/lib/simple_form/error_notification.rb +1 -0
- data/lib/simple_form/form_builder.rb +193 -80
- data/lib/simple_form/helpers/autofocus.rb +1 -0
- data/lib/simple_form/helpers/disabled.rb +1 -0
- data/lib/simple_form/helpers/readonly.rb +1 -0
- data/lib/simple_form/helpers/required.rb +1 -0
- data/lib/simple_form/helpers/validators.rb +2 -1
- data/lib/simple_form/helpers.rb +6 -5
- data/lib/simple_form/i18n_cache.rb +1 -0
- data/lib/simple_form/inputs/base.rb +57 -14
- data/lib/simple_form/inputs/block_input.rb +2 -1
- data/lib/simple_form/inputs/boolean_input.rb +39 -16
- data/lib/simple_form/inputs/collection_check_boxes_input.rb +2 -1
- data/lib/simple_form/inputs/collection_input.rb +37 -14
- data/lib/simple_form/inputs/collection_radio_buttons_input.rb +9 -13
- data/lib/simple_form/inputs/collection_select_input.rb +5 -2
- data/lib/simple_form/inputs/date_time_input.rb +24 -9
- data/lib/simple_form/inputs/file_input.rb +5 -2
- data/lib/simple_form/inputs/grouped_collection_select_input.rb +16 -3
- data/lib/simple_form/inputs/hidden_input.rb +5 -2
- data/lib/simple_form/inputs/numeric_input.rb +6 -4
- data/lib/simple_form/inputs/password_input.rb +6 -3
- data/lib/simple_form/inputs/priority_input.rb +5 -2
- data/lib/simple_form/inputs/range_input.rb +2 -1
- data/lib/simple_form/inputs/string_input.rb +6 -3
- data/lib/simple_form/inputs/text_input.rb +6 -3
- data/lib/simple_form/inputs.rb +1 -0
- data/lib/simple_form/map_type.rb +1 -0
- data/lib/simple_form/railtie.rb +8 -0
- data/lib/simple_form/tags.rb +7 -0
- data/lib/simple_form/version.rb +2 -1
- data/lib/simple_form/wrappers/builder.rb +7 -6
- data/lib/simple_form/wrappers/leaf.rb +29 -0
- data/lib/simple_form/wrappers/many.rb +7 -6
- data/lib/simple_form/wrappers/root.rb +3 -1
- data/lib/simple_form/wrappers/single.rb +7 -4
- data/lib/simple_form/wrappers.rb +2 -0
- data/lib/simple_form.rb +117 -18
- data/test/action_view_extensions/builder_test.rb +42 -41
- data/test/action_view_extensions/form_helper_test.rb +36 -16
- data/test/components/custom_components_test.rb +62 -0
- data/test/components/label_test.rb +70 -41
- data/test/form_builder/association_test.rb +79 -37
- data/test/form_builder/button_test.rb +11 -10
- data/test/form_builder/error_notification_test.rb +2 -1
- data/test/form_builder/error_test.rb +173 -24
- data/test/form_builder/general_test.rb +171 -73
- data/test/form_builder/hint_test.rb +24 -18
- data/test/form_builder/input_field_test.rb +132 -56
- data/test/form_builder/label_test.rb +68 -13
- data/test/form_builder/wrapper_test.rb +190 -22
- data/test/generators/simple_form_generator_test.rb +8 -7
- data/test/inputs/boolean_input_test.rb +89 -6
- data/test/inputs/collection_check_boxes_input_test.rb +109 -25
- data/test/inputs/collection_radio_buttons_input_test.rb +168 -54
- data/test/inputs/collection_select_input_test.rb +183 -77
- data/test/inputs/datetime_input_test.rb +131 -50
- data/test/inputs/disabled_test.rb +16 -15
- data/test/inputs/discovery_test.rb +58 -6
- data/test/inputs/file_input_test.rb +3 -2
- data/test/inputs/general_test.rb +23 -22
- data/test/inputs/grouped_collection_select_input_test.rb +54 -17
- data/test/inputs/hidden_input_test.rb +5 -4
- data/test/inputs/numeric_input_test.rb +48 -44
- data/test/inputs/priority_input_test.rb +23 -14
- data/test/inputs/readonly_test.rb +20 -19
- data/test/inputs/required_test.rb +58 -13
- data/test/inputs/string_input_test.rb +62 -33
- data/test/inputs/text_input_test.rb +20 -7
- data/test/simple_form_test.rb +9 -0
- data/test/support/discovery_inputs.rb +33 -2
- data/test/support/misc_helpers.rb +113 -5
- data/test/support/mock_controller.rb +7 -1
- data/test/support/models.rb +137 -37
- data/test/test_helper.rb +15 -1
- metadata +25 -33
data/test/support/models.rb
CHANGED
|
@@ -1,22 +1,45 @@
|
|
|
1
|
-
|
|
1
|
+
# frozen_string_literal: true
|
|
2
|
+
Association = Struct.new(:klass, :name, :macro, :scope, :options)
|
|
2
3
|
|
|
3
4
|
Column = Struct.new(:name, :type, :limit) do
|
|
4
|
-
# Returns +true+ if the column is either of type integer, float or decimal.
|
|
5
|
-
def number?
|
|
6
|
-
type == :integer || type == :float || type == :decimal
|
|
7
|
-
end
|
|
8
5
|
end
|
|
9
6
|
|
|
10
|
-
Relation = Struct.new(:
|
|
7
|
+
Relation = Struct.new(:records) do
|
|
8
|
+
delegate :each, to: :records
|
|
9
|
+
|
|
11
10
|
def where(conditions = nil)
|
|
12
|
-
self.class.new conditions ?
|
|
11
|
+
self.class.new conditions ? [records.first] : records
|
|
13
12
|
end
|
|
14
13
|
|
|
15
14
|
def order(conditions = nil)
|
|
16
|
-
self.class.new conditions ?
|
|
15
|
+
self.class.new conditions ? records.last : records
|
|
17
16
|
end
|
|
18
17
|
|
|
19
|
-
alias_method :to_a,
|
|
18
|
+
alias_method :to_a, :records
|
|
19
|
+
alias_method :to_ary, :records
|
|
20
|
+
end
|
|
21
|
+
|
|
22
|
+
Decorator = Struct.new(:object) do
|
|
23
|
+
def to_model
|
|
24
|
+
object
|
|
25
|
+
end
|
|
26
|
+
end
|
|
27
|
+
|
|
28
|
+
Picture = Struct.new(:id, :name) do
|
|
29
|
+
extend ActiveModel::Naming
|
|
30
|
+
include ActiveModel::Conversion
|
|
31
|
+
|
|
32
|
+
def self.where(conditions = nil)
|
|
33
|
+
if conditions.is_a?(Hash) && conditions[:name]
|
|
34
|
+
all.to_a.last
|
|
35
|
+
else
|
|
36
|
+
all
|
|
37
|
+
end
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
def self.all
|
|
41
|
+
Relation.new((1..3).map { |i| new(i, "#{name} #{i}") })
|
|
42
|
+
end
|
|
20
43
|
end
|
|
21
44
|
|
|
22
45
|
Company = Struct.new(:id, :name) do
|
|
@@ -28,8 +51,21 @@ Company = Struct.new(:id, :name) do
|
|
|
28
51
|
end
|
|
29
52
|
|
|
30
53
|
def self._relation
|
|
31
|
-
|
|
54
|
+
all
|
|
55
|
+
end
|
|
56
|
+
|
|
57
|
+
def self.all
|
|
58
|
+
Relation.new((1..3).map { |i| new(i, "#{name} #{i}") })
|
|
59
|
+
end
|
|
60
|
+
|
|
61
|
+
def persisted?
|
|
62
|
+
true
|
|
32
63
|
end
|
|
64
|
+
end
|
|
65
|
+
|
|
66
|
+
Friend = Struct.new(:id, :name) do
|
|
67
|
+
extend ActiveModel::Naming
|
|
68
|
+
include ActiveModel::Conversion
|
|
33
69
|
|
|
34
70
|
def self.all
|
|
35
71
|
(1..3).map { |i| new(i, "#{name} #{i}") }
|
|
@@ -53,7 +89,9 @@ class User
|
|
|
53
89
|
:delivery_time, :born_at, :special_company_id, :country, :tags, :tag_ids,
|
|
54
90
|
:avatar, :home_picture, :email, :status, :residence_country, :phone_number,
|
|
55
91
|
:post_count, :lock_version, :amount, :attempts, :action, :credit_card, :gender,
|
|
56
|
-
:extra_special_company_id
|
|
92
|
+
:extra_special_company_id, :pictures, :picture_ids, :special_pictures,
|
|
93
|
+
:special_picture_ids, :uuid, :friends, :friend_ids, :special_tags, :special_tag_ids,
|
|
94
|
+
:citext, :hstore, :json, :jsonb
|
|
57
95
|
|
|
58
96
|
def self.build(extra_attributes = {})
|
|
59
97
|
attributes = {
|
|
@@ -66,7 +104,7 @@ class User
|
|
|
66
104
|
new attributes
|
|
67
105
|
end
|
|
68
106
|
|
|
69
|
-
def initialize(options={})
|
|
107
|
+
def initialize(options = {})
|
|
70
108
|
@new_record = false
|
|
71
109
|
options.each do |key, value|
|
|
72
110
|
send("#{key}=", value)
|
|
@@ -104,11 +142,63 @@ class User
|
|
|
104
142
|
when :attempts then :integer
|
|
105
143
|
when :action then :string
|
|
106
144
|
when :credit_card then :string
|
|
145
|
+
else attribute.to_sym
|
|
107
146
|
end
|
|
108
147
|
Column.new(attribute, column_type, limit)
|
|
109
148
|
end
|
|
110
149
|
|
|
111
|
-
|
|
150
|
+
begin
|
|
151
|
+
require 'active_model/type'
|
|
152
|
+
begin
|
|
153
|
+
ActiveModel::Type.lookup(:text)
|
|
154
|
+
rescue ArgumentError # :text is no longer an ActiveModel::Type
|
|
155
|
+
# But we don't want our tests to depend on ActiveRecord
|
|
156
|
+
class ::ActiveModel::Type::Text < ActiveModel::Type::String
|
|
157
|
+
def type; :text; end
|
|
158
|
+
end
|
|
159
|
+
ActiveModel::Type.register(:text, ActiveModel::Type::Text)
|
|
160
|
+
end
|
|
161
|
+
def type_for_attribute(attribute)
|
|
162
|
+
column_type, limit = case attribute
|
|
163
|
+
when 'name', 'status', 'password' then [:string, 100]
|
|
164
|
+
when 'description' then [:text, 200]
|
|
165
|
+
when 'age' then :integer
|
|
166
|
+
when 'credit_limit' then [:decimal, 15]
|
|
167
|
+
when 'active' then :boolean
|
|
168
|
+
when 'born_at' then :date
|
|
169
|
+
when 'delivery_time' then :time
|
|
170
|
+
when 'created_at' then :datetime
|
|
171
|
+
when 'updated_at' then :datetime
|
|
172
|
+
when 'lock_version' then :integer
|
|
173
|
+
when 'home_picture' then :string
|
|
174
|
+
when 'amount' then :integer
|
|
175
|
+
when 'attempts' then :integer
|
|
176
|
+
when 'action' then :string
|
|
177
|
+
when 'credit_card' then :string
|
|
178
|
+
when 'uuid' then :string
|
|
179
|
+
when 'citext' then :string
|
|
180
|
+
when 'hstore' then [:text, 200]
|
|
181
|
+
when 'json' then [:text, 200]
|
|
182
|
+
when 'jsonb' then [:text, 200]
|
|
183
|
+
end
|
|
184
|
+
|
|
185
|
+
ActiveModel::Type.lookup(column_type, limit: limit)
|
|
186
|
+
end
|
|
187
|
+
rescue LoadError
|
|
188
|
+
end
|
|
189
|
+
|
|
190
|
+
def has_attribute?(attribute)
|
|
191
|
+
case attribute.to_sym
|
|
192
|
+
when :name, :status, :password, :description, :age,
|
|
193
|
+
:credit_limit, :active, :born_at, :delivery_time,
|
|
194
|
+
:created_at, :updated_at, :lock_version, :home_picture,
|
|
195
|
+
:amount, :attempts, :action, :credit_card, :uuid,
|
|
196
|
+
:citext, :hstore, :json, :jsonb then true
|
|
197
|
+
else false
|
|
198
|
+
end
|
|
199
|
+
end
|
|
200
|
+
|
|
201
|
+
def self.human_attribute_name(attribute, options = {})
|
|
112
202
|
case attribute
|
|
113
203
|
when 'name'
|
|
114
204
|
'Super User Name!'
|
|
@@ -117,35 +207,43 @@ class User
|
|
|
117
207
|
when 'company'
|
|
118
208
|
'Company Human Name!'
|
|
119
209
|
else
|
|
120
|
-
attribute.humanize
|
|
210
|
+
attribute.to_s.humanize
|
|
121
211
|
end
|
|
122
212
|
end
|
|
123
213
|
|
|
124
214
|
def self.reflect_on_association(association)
|
|
125
215
|
case association
|
|
126
216
|
when :company
|
|
127
|
-
Association.new(Company, association, :belongs_to, {})
|
|
217
|
+
Association.new(Company, association, :belongs_to, nil, {})
|
|
128
218
|
when :tags
|
|
129
|
-
Association.new(Tag, association, :has_many, {})
|
|
219
|
+
Association.new(Tag, association, :has_many, nil, {})
|
|
220
|
+
when :special_tags
|
|
221
|
+
Association.new(Tag, association, :has_many, ->(user) { where(id: user.id) }, {})
|
|
130
222
|
when :first_company
|
|
131
|
-
Association.new(Company, association, :has_one, {})
|
|
223
|
+
Association.new(Company, association, :has_one, nil, {})
|
|
132
224
|
when :special_company
|
|
133
|
-
Association.new(Company, association, :belongs_to,
|
|
225
|
+
Association.new(Company, association, :belongs_to, nil, conditions: { id: 1 })
|
|
134
226
|
when :extra_special_company
|
|
135
|
-
Association.new(Company, association, :belongs_to,
|
|
227
|
+
Association.new(Company, association, :belongs_to, nil, conditions: proc { { id: self.id } })
|
|
228
|
+
when :pictures
|
|
229
|
+
Association.new(Picture, association, :has_many, nil, {})
|
|
230
|
+
when :special_pictures
|
|
231
|
+
Association.new(Picture, association, :has_many, proc { where(name: self.name) }, {})
|
|
232
|
+
when :friends
|
|
233
|
+
Association.new(Friend, association, :has_many, nil, {})
|
|
136
234
|
end
|
|
137
235
|
end
|
|
138
236
|
|
|
139
237
|
def errors
|
|
140
238
|
@errors ||= begin
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
239
|
+
errors = ActiveModel::Errors.new(self)
|
|
240
|
+
errors.add(:name, "cannot be blank")
|
|
241
|
+
errors.add(:description, 'must be longer than 15 characters')
|
|
242
|
+
errors.add(:age, 'is not a number')
|
|
243
|
+
errors.add(:age, 'must be greater than 18')
|
|
244
|
+
errors.add(:company, 'company must be present')
|
|
245
|
+
errors.add(:company_id, 'must be valid')
|
|
246
|
+
errors
|
|
149
247
|
end
|
|
150
248
|
end
|
|
151
249
|
|
|
@@ -158,8 +256,8 @@ class ValidatingUser < User
|
|
|
158
256
|
include ActiveModel::Validations
|
|
159
257
|
validates :name, presence: true
|
|
160
258
|
validates :company, presence: true
|
|
161
|
-
validates :age, presence: true, if:
|
|
162
|
-
validates :amount, presence: true, unless:
|
|
259
|
+
validates :age, presence: true, if: proc { |user| user.name }
|
|
260
|
+
validates :amount, presence: true, unless: proc { |user| user.age }
|
|
163
261
|
|
|
164
262
|
validates :action, presence: true, on: :create
|
|
165
263
|
validates :credit_limit, presence: true, on: :save
|
|
@@ -177,9 +275,11 @@ class ValidatingUser < User
|
|
|
177
275
|
greater_than_or_equal_to: :min_attempts,
|
|
178
276
|
less_than_or_equal_to: :max_attempts,
|
|
179
277
|
only_integer: true
|
|
180
|
-
validates_length_of :name, maximum: 25
|
|
181
|
-
validates_length_of :description,
|
|
182
|
-
|
|
278
|
+
validates_length_of :name, maximum: 25, minimum: 5
|
|
279
|
+
validates_length_of :description, in: 15..50
|
|
280
|
+
if ActionPack::VERSION::STRING < '5'
|
|
281
|
+
validates_length_of :action, maximum: 10, tokenizer: ->(str) { str.scan(/\w+/) }
|
|
282
|
+
end
|
|
183
283
|
validates_length_of :home_picture, is: 12
|
|
184
284
|
|
|
185
285
|
def min_amount
|
|
@@ -206,16 +306,16 @@ class OtherValidatingUser < User
|
|
|
206
306
|
less_than: 100,
|
|
207
307
|
only_integer: true
|
|
208
308
|
validates_numericality_of :amount,
|
|
209
|
-
greater_than:
|
|
210
|
-
less_than:
|
|
309
|
+
greater_than: proc { |user| user.age },
|
|
310
|
+
less_than: proc { |user| user.age + 100 },
|
|
211
311
|
only_integer: true
|
|
212
312
|
validates_numericality_of :attempts,
|
|
213
|
-
greater_than_or_equal_to:
|
|
214
|
-
less_than_or_equal_to:
|
|
313
|
+
greater_than_or_equal_to: proc { |user| user.age },
|
|
314
|
+
less_than_or_equal_to: proc { |user| user.age + 100 },
|
|
215
315
|
only_integer: true
|
|
216
316
|
|
|
217
317
|
validates_format_of :country, with: /\w+/
|
|
218
|
-
validates_format_of :name, with:
|
|
318
|
+
validates_format_of :name, with: proc { /\w+/ }
|
|
219
319
|
validates_format_of :description, without: /\d+/
|
|
220
320
|
end
|
|
221
321
|
|
data/test/test_helper.rb
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
# frozen_string_literal: true
|
|
1
2
|
require 'bundler/setup'
|
|
2
3
|
|
|
3
4
|
require 'minitest/autorun'
|
|
@@ -5,6 +6,8 @@ require 'minitest/autorun'
|
|
|
5
6
|
require 'active_model'
|
|
6
7
|
require 'action_controller'
|
|
7
8
|
require 'action_view'
|
|
9
|
+
ActionView::RoutingUrlFor.send(:include, ActionDispatch::Routing::UrlFor)
|
|
10
|
+
|
|
8
11
|
require 'action_view/template'
|
|
9
12
|
|
|
10
13
|
require 'action_view/test_case'
|
|
@@ -28,7 +31,15 @@ I18n.default_locale = :en
|
|
|
28
31
|
|
|
29
32
|
require 'country_select'
|
|
30
33
|
|
|
31
|
-
|
|
34
|
+
if defined?(HTMLSelector::NO_STRIP)
|
|
35
|
+
HTMLSelector::NO_STRIP << "label"
|
|
36
|
+
else
|
|
37
|
+
ActionDispatch::Assertions::NO_STRIP << "label"
|
|
38
|
+
end
|
|
39
|
+
|
|
40
|
+
if ActiveSupport::TestCase.respond_to?(:test_order=)
|
|
41
|
+
ActiveSupport::TestCase.test_order = :random
|
|
42
|
+
end
|
|
32
43
|
|
|
33
44
|
class ActionView::TestCase
|
|
34
45
|
include MiscHelpers
|
|
@@ -43,8 +54,11 @@ class ActionView::TestCase
|
|
|
43
54
|
|
|
44
55
|
def setup_users(extra_attributes = {})
|
|
45
56
|
@user = User.build(extra_attributes)
|
|
57
|
+
@decorated_user = Decorator.new(@user)
|
|
46
58
|
|
|
47
59
|
@validating_user = ValidatingUser.build({
|
|
60
|
+
name: 'Tester McTesterson',
|
|
61
|
+
description: 'A test user of the most distinguised caliber',
|
|
48
62
|
home_picture: 'Home picture',
|
|
49
63
|
age: 19,
|
|
50
64
|
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:
|
|
4
|
+
version: 4.0.0
|
|
5
5
|
platform: ruby
|
|
6
6
|
authors:
|
|
7
7
|
- José Valim
|
|
@@ -10,50 +10,38 @@ authors:
|
|
|
10
10
|
autorequire:
|
|
11
11
|
bindir: bin
|
|
12
12
|
cert_chain: []
|
|
13
|
-
date:
|
|
13
|
+
date: 2018-04-11 00:00:00.000000000 Z
|
|
14
14
|
dependencies:
|
|
15
15
|
- !ruby/object:Gem::Dependency
|
|
16
16
|
name: activemodel
|
|
17
17
|
requirement: !ruby/object:Gem::Requirement
|
|
18
18
|
requirements:
|
|
19
|
-
- -
|
|
19
|
+
- - ">"
|
|
20
20
|
- !ruby/object:Gem::Version
|
|
21
|
-
version: 4
|
|
22
|
-
- - <
|
|
23
|
-
- !ruby/object:Gem::Version
|
|
24
|
-
version: '4.1'
|
|
21
|
+
version: '4'
|
|
25
22
|
type: :runtime
|
|
26
23
|
prerelease: false
|
|
27
24
|
version_requirements: !ruby/object:Gem::Requirement
|
|
28
25
|
requirements:
|
|
29
|
-
- -
|
|
30
|
-
- !ruby/object:Gem::Version
|
|
31
|
-
version: 4.0.0
|
|
32
|
-
- - <
|
|
26
|
+
- - ">"
|
|
33
27
|
- !ruby/object:Gem::Version
|
|
34
|
-
version: '4
|
|
28
|
+
version: '4'
|
|
35
29
|
- !ruby/object:Gem::Dependency
|
|
36
30
|
name: actionpack
|
|
37
31
|
requirement: !ruby/object:Gem::Requirement
|
|
38
32
|
requirements:
|
|
39
|
-
- -
|
|
40
|
-
- !ruby/object:Gem::Version
|
|
41
|
-
version: 4.0.0
|
|
42
|
-
- - <
|
|
33
|
+
- - ">"
|
|
43
34
|
- !ruby/object:Gem::Version
|
|
44
|
-
version: '4
|
|
35
|
+
version: '4'
|
|
45
36
|
type: :runtime
|
|
46
37
|
prerelease: false
|
|
47
38
|
version_requirements: !ruby/object:Gem::Requirement
|
|
48
39
|
requirements:
|
|
49
|
-
- -
|
|
40
|
+
- - ">"
|
|
50
41
|
- !ruby/object:Gem::Version
|
|
51
|
-
version: 4
|
|
52
|
-
- - <
|
|
53
|
-
- !ruby/object:Gem::Version
|
|
54
|
-
version: '4.1'
|
|
42
|
+
version: '4'
|
|
55
43
|
description: Forms made easy!
|
|
56
|
-
email:
|
|
44
|
+
email: opensource@plataformatec.com.br
|
|
57
45
|
executables: []
|
|
58
46
|
extensions: []
|
|
59
47
|
extra_rdoc_files: []
|
|
@@ -61,7 +49,9 @@ files:
|
|
|
61
49
|
- CHANGELOG.md
|
|
62
50
|
- MIT-LICENSE
|
|
63
51
|
- README.md
|
|
52
|
+
- lib/generators/simple_form/USAGE
|
|
64
53
|
- lib/generators/simple_form/install_generator.rb
|
|
54
|
+
- lib/generators/simple_form/templates/README
|
|
65
55
|
- lib/generators/simple_form/templates/_form.html.erb
|
|
66
56
|
- lib/generators/simple_form/templates/_form.html.haml
|
|
67
57
|
- lib/generators/simple_form/templates/_form.html.slim
|
|
@@ -69,10 +59,10 @@ files:
|
|
|
69
59
|
- lib/generators/simple_form/templates/config/initializers/simple_form_bootstrap.rb
|
|
70
60
|
- lib/generators/simple_form/templates/config/initializers/simple_form_foundation.rb
|
|
71
61
|
- lib/generators/simple_form/templates/config/locales/simple_form.en.yml
|
|
72
|
-
- lib/
|
|
73
|
-
- lib/generators/simple_form/USAGE
|
|
62
|
+
- lib/simple_form.rb
|
|
74
63
|
- lib/simple_form/action_view_extensions/builder.rb
|
|
75
64
|
- lib/simple_form/action_view_extensions/form_helper.rb
|
|
65
|
+
- lib/simple_form/components.rb
|
|
76
66
|
- lib/simple_form/components/errors.rb
|
|
77
67
|
- lib/simple_form/components/hints.rb
|
|
78
68
|
- lib/simple_form/components/html5.rb
|
|
@@ -80,19 +70,20 @@ files:
|
|
|
80
70
|
- lib/simple_form/components/labels.rb
|
|
81
71
|
- lib/simple_form/components/maxlength.rb
|
|
82
72
|
- lib/simple_form/components/min_max.rb
|
|
73
|
+
- lib/simple_form/components/minlength.rb
|
|
83
74
|
- lib/simple_form/components/pattern.rb
|
|
84
75
|
- lib/simple_form/components/placeholders.rb
|
|
85
76
|
- lib/simple_form/components/readonly.rb
|
|
86
|
-
- lib/simple_form/components.rb
|
|
87
77
|
- lib/simple_form/error_notification.rb
|
|
88
78
|
- lib/simple_form/form_builder.rb
|
|
79
|
+
- lib/simple_form/helpers.rb
|
|
89
80
|
- lib/simple_form/helpers/autofocus.rb
|
|
90
81
|
- lib/simple_form/helpers/disabled.rb
|
|
91
82
|
- lib/simple_form/helpers/readonly.rb
|
|
92
83
|
- lib/simple_form/helpers/required.rb
|
|
93
84
|
- lib/simple_form/helpers/validators.rb
|
|
94
|
-
- lib/simple_form/helpers.rb
|
|
95
85
|
- lib/simple_form/i18n_cache.rb
|
|
86
|
+
- lib/simple_form/inputs.rb
|
|
96
87
|
- lib/simple_form/inputs/base.rb
|
|
97
88
|
- lib/simple_form/inputs/block_input.rb
|
|
98
89
|
- lib/simple_form/inputs/boolean_input.rb
|
|
@@ -110,19 +101,19 @@ files:
|
|
|
110
101
|
- lib/simple_form/inputs/range_input.rb
|
|
111
102
|
- lib/simple_form/inputs/string_input.rb
|
|
112
103
|
- lib/simple_form/inputs/text_input.rb
|
|
113
|
-
- lib/simple_form/inputs.rb
|
|
114
104
|
- lib/simple_form/map_type.rb
|
|
115
105
|
- lib/simple_form/railtie.rb
|
|
116
106
|
- lib/simple_form/tags.rb
|
|
117
107
|
- lib/simple_form/version.rb
|
|
108
|
+
- lib/simple_form/wrappers.rb
|
|
118
109
|
- lib/simple_form/wrappers/builder.rb
|
|
110
|
+
- lib/simple_form/wrappers/leaf.rb
|
|
119
111
|
- lib/simple_form/wrappers/many.rb
|
|
120
112
|
- lib/simple_form/wrappers/root.rb
|
|
121
113
|
- lib/simple_form/wrappers/single.rb
|
|
122
|
-
- lib/simple_form/wrappers.rb
|
|
123
|
-
- lib/simple_form.rb
|
|
124
114
|
- test/action_view_extensions/builder_test.rb
|
|
125
115
|
- test/action_view_extensions/form_helper_test.rb
|
|
116
|
+
- test/components/custom_components_test.rb
|
|
126
117
|
- test/components/label_test.rb
|
|
127
118
|
- test/form_builder/association_test.rb
|
|
128
119
|
- test/form_builder/button_test.rb
|
|
@@ -167,23 +158,24 @@ require_paths:
|
|
|
167
158
|
- lib
|
|
168
159
|
required_ruby_version: !ruby/object:Gem::Requirement
|
|
169
160
|
requirements:
|
|
170
|
-
- -
|
|
161
|
+
- - ">="
|
|
171
162
|
- !ruby/object:Gem::Version
|
|
172
163
|
version: '0'
|
|
173
164
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
|
174
165
|
requirements:
|
|
175
|
-
- -
|
|
166
|
+
- - ">="
|
|
176
167
|
- !ruby/object:Gem::Version
|
|
177
168
|
version: '0'
|
|
178
169
|
requirements: []
|
|
179
170
|
rubyforge_project: simple_form
|
|
180
|
-
rubygems_version: 2.
|
|
171
|
+
rubygems_version: 2.6.11
|
|
181
172
|
signing_key:
|
|
182
173
|
specification_version: 4
|
|
183
174
|
summary: Forms made easy!
|
|
184
175
|
test_files:
|
|
185
176
|
- test/action_view_extensions/builder_test.rb
|
|
186
177
|
- test/action_view_extensions/form_helper_test.rb
|
|
178
|
+
- test/components/custom_components_test.rb
|
|
187
179
|
- test/components/label_test.rb
|
|
188
180
|
- test/form_builder/association_test.rb
|
|
189
181
|
- test/form_builder/button_test.rb
|