simple_form 1.5.2 → 2.0.0.rc

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 (105) hide show
  1. data/CHANGELOG.md +224 -0
  2. data/MIT-LICENSE +1 -1
  3. data/README.md +817 -0
  4. data/lib/generators/simple_form/install_generator.rb +15 -1
  5. data/lib/generators/simple_form/templates/README +12 -0
  6. data/lib/generators/simple_form/templates/config/initializers/simple_form.rb.tt +173 -0
  7. data/lib/simple_form.rb +109 -43
  8. data/lib/simple_form/action_view_extensions/builder.rb +158 -53
  9. data/lib/simple_form/action_view_extensions/form_helper.rb +29 -22
  10. data/lib/simple_form/components.rb +11 -1
  11. data/lib/simple_form/components/errors.rb +6 -24
  12. data/lib/simple_form/components/hints.rb +7 -21
  13. data/lib/simple_form/components/html5.rb +26 -0
  14. data/lib/simple_form/components/labels.rb +15 -13
  15. data/lib/simple_form/components/maxlength.rb +41 -0
  16. data/lib/simple_form/components/min_max.rb +49 -0
  17. data/lib/simple_form/components/pattern.rb +34 -0
  18. data/lib/simple_form/components/placeholders.rb +5 -17
  19. data/lib/simple_form/components/readonly.rb +22 -0
  20. data/lib/simple_form/core_ext/hash.rb +16 -0
  21. data/lib/simple_form/error_notification.rb +8 -1
  22. data/lib/simple_form/form_builder.rb +86 -22
  23. data/lib/simple_form/helpers.rb +7 -4
  24. data/lib/simple_form/helpers/autofocus.rb +11 -0
  25. data/lib/simple_form/helpers/disabled.rb +15 -0
  26. data/lib/simple_form/helpers/readonly.rb +15 -0
  27. data/lib/simple_form/helpers/required.rb +7 -10
  28. data/lib/simple_form/helpers/validators.rb +4 -4
  29. data/lib/simple_form/inputs.rb +17 -13
  30. data/lib/simple_form/inputs/base.rb +50 -81
  31. data/lib/simple_form/inputs/boolean_input.rb +43 -4
  32. data/lib/simple_form/inputs/collection_check_boxes_input.rb +21 -0
  33. data/lib/simple_form/inputs/collection_input.rb +27 -13
  34. data/lib/simple_form/inputs/collection_radio_buttons_input.rb +69 -0
  35. data/lib/simple_form/inputs/collection_select_input.rb +14 -0
  36. data/lib/simple_form/inputs/date_time_input.rb +2 -2
  37. data/lib/simple_form/inputs/grouped_collection_select_input.rb +41 -0
  38. data/lib/simple_form/inputs/hidden_input.rb +3 -6
  39. data/lib/simple_form/inputs/numeric_input.rb +3 -51
  40. data/lib/simple_form/inputs/password_input.rb +1 -2
  41. data/lib/simple_form/inputs/priority_input.rb +2 -2
  42. data/lib/simple_form/inputs/range_input.rb +1 -3
  43. data/lib/simple_form/inputs/string_input.rb +6 -8
  44. data/lib/simple_form/inputs/text_input.rb +1 -2
  45. data/lib/simple_form/version.rb +1 -1
  46. data/lib/simple_form/wrappers.rb +8 -0
  47. data/lib/simple_form/wrappers/builder.rb +75 -0
  48. data/lib/simple_form/wrappers/many.rb +68 -0
  49. data/lib/simple_form/wrappers/root.rb +34 -0
  50. data/lib/simple_form/wrappers/single.rb +18 -0
  51. data/test/action_view_extensions/builder_test.rb +195 -100
  52. data/test/action_view_extensions/form_helper_test.rb +24 -2
  53. data/test/components/label_test.rb +20 -5
  54. data/test/form_builder/association_test.rb +167 -0
  55. data/test/form_builder/button_test.rb +28 -0
  56. data/test/{error_notification_test.rb → form_builder/error_notification_test.rb} +2 -1
  57. data/test/form_builder/error_test.rb +101 -0
  58. data/test/form_builder/general_test.rb +348 -0
  59. data/test/form_builder/hint_test.rb +115 -0
  60. data/test/form_builder/input_field_test.rb +51 -0
  61. data/test/form_builder/label_test.rb +51 -0
  62. data/test/form_builder/wrapper_test.rb +140 -0
  63. data/test/generators/simple_form_generator_test.rb +32 -0
  64. data/test/inputs/boolean_input_test.rb +91 -0
  65. data/test/inputs/collection_check_boxes_input_test.rb +224 -0
  66. data/test/inputs/collection_radio_buttons_input_test.rb +326 -0
  67. data/test/inputs/collection_select_input_test.rb +241 -0
  68. data/test/inputs/datetime_input_test.rb +85 -0
  69. data/test/inputs/disabled_test.rb +38 -0
  70. data/test/inputs/discovery_test.rb +61 -0
  71. data/test/inputs/file_input_test.rb +16 -0
  72. data/test/inputs/general_test.rb +69 -0
  73. data/test/inputs/grouped_collection_select_input_test.rb +109 -0
  74. data/test/inputs/hidden_input_test.rb +30 -0
  75. data/test/inputs/numeric_input_test.rb +167 -0
  76. data/test/inputs/priority_input_test.rb +43 -0
  77. data/test/inputs/readonly_test.rb +61 -0
  78. data/test/inputs/required_test.rb +113 -0
  79. data/test/inputs/string_input_test.rb +140 -0
  80. data/test/inputs/text_input_test.rb +24 -0
  81. data/test/{discovery_inputs.rb → support/discovery_inputs.rb} +0 -0
  82. data/test/support/misc_helpers.rb +48 -6
  83. data/test/support/mock_controller.rb +2 -2
  84. data/test/support/models.rb +20 -5
  85. data/test/test_helper.rb +5 -8
  86. metadata +123 -98
  87. data/.gitignore +0 -3
  88. data/.gitmodules +0 -3
  89. data/.travis.yml +0 -15
  90. data/CHANGELOG.rdoc +0 -159
  91. data/Gemfile +0 -9
  92. data/README.rdoc +0 -466
  93. data/Rakefile +0 -27
  94. data/lib/generators/simple_form/templates/config/initializers/simple_form.rb +0 -93
  95. data/lib/simple_form/components/wrapper.rb +0 -38
  96. data/lib/simple_form/helpers/has_errors.rb +0 -15
  97. data/lib/simple_form/helpers/maxlength.rb +0 -24
  98. data/lib/simple_form/helpers/pattern.rb +0 -28
  99. data/simple_form.gemspec +0 -25
  100. data/test/components/error_test.rb +0 -56
  101. data/test/components/hint_test.rb +0 -74
  102. data/test/components/wrapper_test.rb +0 -63
  103. data/test/custom_components.rb +0 -7
  104. data/test/form_builder_test.rb +0 -930
  105. data/test/inputs_test.rb +0 -995
@@ -0,0 +1,140 @@
1
+ # encoding: UTF-8
2
+ require 'test_helper'
3
+
4
+ class StringInputTest < ActionView::TestCase
5
+ test 'input should map text field to string attribute' do
6
+ with_input_for @user, :name, :string
7
+ assert_select "input#user_name[type=text][name='user[name]'][value=New in Simple Form!]"
8
+ end
9
+
10
+ test 'input should generate a password field for password attributes' do
11
+ with_input_for @user, :password, :password
12
+ assert_select "input#user_password.password[type=password][name='user[password]']"
13
+ end
14
+
15
+ test 'input should not use size attribute for decimal attributes' do
16
+ with_input_for @user, :credit_limit, :decimal
17
+ assert_no_select 'input.decimal[size]'
18
+ end
19
+
20
+ test 'input should get maxlength from column definition for string attributes' do
21
+ with_input_for @user, :name, :string
22
+ assert_select 'input.string[maxlength=100]'
23
+ end
24
+
25
+ test 'input should not get maxlength from column without size definition for string attributes' do
26
+ with_input_for @user, :action, :string
27
+ assert_no_select 'input.string[maxlength]'
28
+ end
29
+
30
+ test 'input should get size from column definition for string attributes respecting maximum value' do
31
+ with_input_for @user, :name, :string
32
+ assert_select 'input.string[size=50]'
33
+ end
34
+
35
+ test 'input should use default text size for password attributes' do
36
+ with_input_for @user, :password, :password
37
+ assert_select 'input.password[type=password][size=50]'
38
+ end
39
+
40
+ test 'input should get maxlength from column definition for password attributes' do
41
+ with_input_for @user, :password, :password
42
+ assert_select 'input.password[type=password][maxlength=100]'
43
+ end
44
+
45
+ test 'input should infer maxlength column definition from validation when present' do
46
+ with_input_for @validating_user, :name, :string
47
+ assert_select 'input.string[maxlength=25]'
48
+ end
49
+
50
+ test 'input should not get maxlength from validation when tokenizer present' do
51
+ with_input_for @validating_user, :action, :string
52
+ assert_no_select 'input.string[maxlength]'
53
+ end
54
+
55
+ test 'input should get maxlength from validation when :is option present' do
56
+ with_input_for @validating_user, :home_picture, :string
57
+ assert_select 'input.string[maxlength=12]'
58
+ end
59
+
60
+ test 'input should not generate placeholder by default' do
61
+ with_input_for @user, :name, :string
62
+ assert_no_select 'input[placeholder]'
63
+ end
64
+
65
+ test 'input should accept the placeholder option' do
66
+ with_input_for @user, :name, :string, :placeholder => 'Put in some text'
67
+ assert_select 'input.string[placeholder=Put in some text]'
68
+ end
69
+
70
+ test 'input should generate a password field for password attributes that accept placeholder' do
71
+ with_input_for @user, :password, :password, :placeholder => 'Password Confirmation'
72
+ assert_select 'input[type=password].password[placeholder=Password Confirmation]#user_password'
73
+ end
74
+
75
+ test 'input should not infer pattern from attributes by default' do
76
+ with_input_for @other_validating_user, :country, :string
77
+ assert_no_select 'input[pattern="\w+"]'
78
+ end
79
+
80
+ test 'input should infer pattern from attributes' do
81
+ with_input_for @other_validating_user, :country, :string, :pattern => true
82
+ assert_select 'input[pattern="\w+"]'
83
+ end
84
+
85
+ test 'input should infer pattern from attributes using proc' do
86
+ with_input_for @other_validating_user, :name, :string, :pattern => true
87
+ assert_select 'input[pattern="\w+"]'
88
+ end
89
+
90
+ test 'input should not infer pattern from attributes if root default is false' do
91
+ swap_wrapper do
92
+ with_input_for @other_validating_user, :country, :string
93
+ assert_no_select 'input[pattern="\w+"]'
94
+ end
95
+ end
96
+
97
+ test 'input should use given pattern from attributes' do
98
+ with_input_for @other_validating_user, :country, :string, :input_html => { :pattern => "\\d+" }
99
+ assert_select 'input[pattern="\d+"]'
100
+ end
101
+
102
+ test 'input should use i18n to translate placeholder text' do
103
+ store_translations(:en, :simple_form => { :placeholders => { :user => {
104
+ :name => 'Name goes here'
105
+ } } }) do
106
+ with_input_for @user, :name, :string
107
+ assert_select 'input.string[placeholder=Name goes here]'
108
+ end
109
+ end
110
+
111
+ [:email, :url, :search, :tel].each do |type|
112
+ test "input should allow type #{type}" do
113
+ with_input_for @user, :name, type
114
+ assert_select "input.string.#{type}"
115
+ assert_select "input[type=#{type}]"
116
+ end
117
+
118
+ test "input should not allow type #{type} if HTML5 compatibility is disabled" do
119
+ swap_wrapper do
120
+ with_input_for @user, :name, type
121
+ assert_select "input[type=text]"
122
+ assert_no_select "input[type=#{type}]"
123
+ end
124
+ end
125
+ end
126
+
127
+ test 'input strips extra spaces from class html attribute with default classes' do
128
+ with_input_for @user, :name, :string
129
+ assert_select "input[class='string required']"
130
+ assert_no_select "input[class='string required ']"
131
+ assert_no_select "input[class=' string required']"
132
+ end
133
+
134
+ test 'input strips extra spaces from class html attribute when giving a custom class' do
135
+ with_input_for @user, :name, :string, :input_html => { :class => "my_input" }
136
+ assert_select "input[class='string required my_input']"
137
+ assert_no_select "input[class='string required my_input ']"
138
+ assert_no_select "input[class=' string required my_input']"
139
+ end
140
+ end
@@ -0,0 +1,24 @@
1
+ # encoding: UTF-8
2
+ require 'test_helper'
3
+
4
+ class TextInputTest < ActionView::TestCase
5
+ test 'input should generate a text area for text attributes' do
6
+ with_input_for @user, :description, :text
7
+ assert_select 'textarea.text#user_description'
8
+ end
9
+
10
+ test 'input should generate a text area for text attributes that accept placeholder' do
11
+ with_input_for @user, :description, :text, :placeholder => 'Put in some text'
12
+ assert_select 'textarea.text[placeholder=Put in some text]'
13
+ end
14
+
15
+ test 'input should get maxlength from column definition for text attributes' do
16
+ with_input_for @user, :description, :text
17
+ assert_select 'textarea.text[maxlength=200]'
18
+ end
19
+
20
+ test 'input should infer maxlength column definition from validation when present for text attributes' do
21
+ with_input_for @validating_user, :description, :text
22
+ assert_select 'textarea.text[maxlength=50]'
23
+ end
24
+ end
@@ -25,12 +25,34 @@ module MiscHelpers
25
25
  end
26
26
  end
27
27
 
28
- def with_concat_form_for(object, &block)
29
- concat simple_form_for(object, &block)
28
+ def swap_wrapper(name=:default, wrapper=self.custom_wrapper)
29
+ old = SimpleForm.wrappers[name]
30
+ SimpleForm.wrappers[name] = wrapper
31
+ yield
32
+ ensure
33
+ SimpleForm.wrappers[name] = old
34
+ end
35
+
36
+ def custom_wrapper
37
+ SimpleForm.build :tag => :section, :class => "custom_wrapper", :pattern => false do |b|
38
+ b.use :pattern
39
+ b.use :another, :class => "another_wrapper" do |ba|
40
+ ba.use :label
41
+ ba.use :input
42
+ end
43
+ b.use :error_wrapper, :tag => :div, :class => "error_wrapper" do |be|
44
+ be.use :error, :tag => :span, :class => "omg_error"
45
+ end
46
+ b.use :hint, :tag => :span, :class => "omg_hint"
47
+ end
30
48
  end
31
49
 
32
- def with_concat_custom_form_for(object, &block)
33
- concat custom_form_for(object, &block)
50
+ def custom_wrapper_without_top_level
51
+ SimpleForm.build :tag => false, :class => 'custom_wrapper_without_top_level' do |b|
52
+ b.use :label_input
53
+ b.use :hint, :tag => :span, :class => :hint
54
+ b.use :error, :tag => :span, :class => :error
55
+ end
34
56
  end
35
57
 
36
58
  def custom_form_for(object, *args, &block)
@@ -41,8 +63,28 @@ module MiscHelpers
41
63
  simple_form_for(object, *(args << { :builder => CustomMapTypeFormBuilder }), &block)
42
64
  end
43
65
 
44
- def with_concat_custom_mapping_form_for(object, &block)
45
- concat custom_mapping_form_for(object, &block)
66
+ def with_concat_form_for(*args, &block)
67
+ concat simple_form_for(*args, &block)
68
+ end
69
+
70
+ def with_concat_custom_form_for(*args, &block)
71
+ concat custom_form_for(*args, &block)
72
+ end
73
+
74
+ def with_concat_custom_mapping_form_for(*args, &block)
75
+ concat custom_mapping_form_for(*args, &block)
76
+ end
77
+
78
+ def with_form_for(object, *args, &block)
79
+ with_concat_form_for(object) do |f|
80
+ f.input(*args, &block)
81
+ end
82
+ end
83
+
84
+ def with_input_for(object, attribute_name, type, options={})
85
+ with_concat_form_for(object) do |f|
86
+ f.input(attribute_name, options.merge(:as => type))
87
+ end
46
88
  end
47
89
  end
48
90
 
@@ -1,12 +1,12 @@
1
1
  class MockController
2
- attr_accessor :action_name
2
+ attr_writer :action_name
3
3
 
4
4
  def _routes
5
5
  self
6
6
  end
7
7
 
8
8
  def action_name
9
- @action_name || "edit"
9
+ defined?(@action_name) ? @action_name : "edit"
10
10
  end
11
11
 
12
12
  def url_for(*args)
@@ -26,14 +26,14 @@ class Company < Struct.new(:id, :name)
26
26
  end
27
27
 
28
28
  class Tag < Company
29
- extend ActiveModel::Naming
30
- include ActiveModel::Conversion
31
-
32
29
  def self.all(options={})
33
30
  (1..3).map{|i| Tag.new(i, "Tag #{i}")}
34
31
  end
35
32
  end
36
33
 
34
+ class TagGroup < Struct.new(:id, :name, :tags)
35
+ end
36
+
37
37
  class User
38
38
  extend ActiveModel::Naming
39
39
  include ActiveModel::Conversion
@@ -42,9 +42,10 @@ class User
42
42
  :description, :created_at, :updated_at, :credit_limit, :password, :url,
43
43
  :delivery_time, :born_at, :special_company_id, :country, :tags, :tag_ids,
44
44
  :avatar, :home_picture, :email, :status, :residence_country, :phone_number,
45
- :post_count, :lock_version, :amount, :attempts, :action
45
+ :post_count, :lock_version, :amount, :attempts, :action, :credit_card, :gender
46
46
 
47
47
  def initialize(options={})
48
+ @new_record = false
48
49
  options.each do |key, value|
49
50
  send("#{key}=", value)
50
51
  end if options
@@ -55,7 +56,7 @@ class User
55
56
  end
56
57
 
57
58
  def persisted?
58
- !(@new_record || false)
59
+ !@new_record
59
60
  end
60
61
 
61
62
  def company_attributes=(*)
@@ -80,6 +81,7 @@ class User
80
81
  when :amount then :integer
81
82
  when :attempts then :integer
82
83
  when :action then :string
84
+ when :credit_card then :string
83
85
  end
84
86
  Column.new(attribute, column_type, limit)
85
87
  end
@@ -122,6 +124,10 @@ class User
122
124
  )
123
125
  end
124
126
  end
127
+
128
+ def self.readonly_attributes
129
+ [:credit_card]
130
+ end
125
131
  end
126
132
 
127
133
  class ValidatingUser < User
@@ -149,6 +155,8 @@ class ValidatingUser < User
149
155
  :only_integer => true
150
156
  validates_length_of :name, :maximum => 25
151
157
  validates_length_of :description, :maximum => 50
158
+ validates_length_of :action, :maximum => 10, :tokenizer => lambda { |str| str.scan(/\w+/) }
159
+ validates_length_of :home_picture, :is => 12
152
160
 
153
161
  def min_amount
154
162
  10
@@ -183,6 +191,13 @@ class OtherValidatingUser < User
183
191
  :only_integer => true
184
192
 
185
193
  validates_format_of :country, :with => /\w+/
194
+
195
+ # TODO: Remove this check when we drop Rails 3.0 support
196
+ if ActiveModel::VERSION::MAJOR == 3 && ActiveModel::VERSION::MINOR >= 1
197
+ validates_format_of :name, :with => Proc.new { /\w+/ }
198
+ else
199
+ validates_format_of :name, :with => /\w+/
200
+ end
186
201
  end
187
202
 
188
203
  class HashBackedAuthor < Hash
data/test/test_helper.rb CHANGED
@@ -22,17 +22,13 @@ end
22
22
  $:.unshift File.expand_path("../../lib", __FILE__)
23
23
  require 'simple_form'
24
24
 
25
+ require "rails/generators/test_case"
26
+ require 'generators/simple_form/install_generator'
27
+
25
28
  Dir["#{File.dirname(__FILE__)}/support/*.rb"].each { |f| require f }
26
29
  I18n.default_locale = :en
27
30
 
28
- country_select = "#{File.dirname(__FILE__)}/support/country_select/lib"
29
-
30
- if File.exists?(country_select)
31
- $:.unshift country_select
32
- require 'country_select'
33
- else
34
- raise "Could not find country_select plugin in test/support. Please execute git submodule update --init."
35
- end
31
+ require 'country_select'
36
32
 
37
33
  class ActionView::TestCase
38
34
  include MiscHelpers
@@ -62,6 +58,7 @@ class ActionView::TestCase
62
58
  :id => 1,
63
59
  :name => 'New in Simple Form!',
64
60
  :description => 'Hello!',
61
+ :home_picture => 'Home picture',
65
62
  :created_at => Time.now,
66
63
  :age => 19,
67
64
  :amount => 15,
metadata CHANGED
@@ -1,104 +1,90 @@
1
- --- !ruby/object:Gem::Specification
1
+ --- !ruby/object:Gem::Specification
2
2
  name: simple_form
3
- version: !ruby/object:Gem::Version
4
- hash: 7
5
- prerelease:
6
- segments:
7
- - 1
8
- - 5
9
- - 2
10
- version: 1.5.2
3
+ version: !ruby/object:Gem::Version
4
+ version: 2.0.0.rc
5
+ prerelease: 6
11
6
  platform: ruby
12
- authors:
13
- - "Jos\xC3\xA9 Valim"
14
- - "Carlos Ant\xC3\xB4nio"
7
+ authors:
8
+ - José Valim
9
+ - Carlos Antônio
10
+ - Rafael França
15
11
  autorequire:
16
12
  bindir: bin
17
13
  cert_chain: []
18
-
19
- date: 2011-09-23 00:00:00 -03:00
20
- default_executable:
21
- dependencies:
22
- - !ruby/object:Gem::Dependency
14
+ date: 2012-02-01 00:00:00.000000000 Z
15
+ dependencies:
16
+ - !ruby/object:Gem::Dependency
23
17
  name: activemodel
24
- prerelease: false
25
- requirement: &id001 !ruby/object:Gem::Requirement
18
+ requirement: &70282593994180 !ruby/object:Gem::Requirement
26
19
  none: false
27
- requirements:
20
+ requirements:
28
21
  - - ~>
29
- - !ruby/object:Gem::Version
30
- hash: 7
31
- segments:
32
- - 3
33
- - 0
34
- version: "3.0"
22
+ - !ruby/object:Gem::Version
23
+ version: '3.0'
35
24
  type: :runtime
36
- version_requirements: *id001
37
- - !ruby/object:Gem::Dependency
38
- name: actionpack
39
25
  prerelease: false
40
- requirement: &id002 !ruby/object:Gem::Requirement
26
+ version_requirements: *70282593994180
27
+ - !ruby/object:Gem::Dependency
28
+ name: actionpack
29
+ requirement: &70282593992720 !ruby/object:Gem::Requirement
41
30
  none: false
42
- requirements:
31
+ requirements:
43
32
  - - ~>
44
- - !ruby/object:Gem::Version
45
- hash: 7
46
- segments:
47
- - 3
48
- - 0
49
- version: "3.0"
33
+ - !ruby/object:Gem::Version
34
+ version: '3.0'
50
35
  type: :runtime
51
- version_requirements: *id002
36
+ prerelease: false
37
+ version_requirements: *70282593992720
52
38
  description: Forms made easy!
53
39
  email: contact@plataformatec.com.br
54
40
  executables: []
55
-
56
41
  extensions: []
57
-
58
42
  extra_rdoc_files: []
59
-
60
- files:
61
- - .gitignore
62
- - .gitmodules
63
- - .travis.yml
64
- - CHANGELOG.rdoc
65
- - Gemfile
43
+ files:
44
+ - CHANGELOG.md
66
45
  - MIT-LICENSE
67
- - README.rdoc
68
- - Rakefile
69
- - lib/generators/simple_form/USAGE
46
+ - README.md
70
47
  - lib/generators/simple_form/install_generator.rb
71
48
  - lib/generators/simple_form/templates/_form.html.erb
72
49
  - lib/generators/simple_form/templates/_form.html.haml
73
50
  - lib/generators/simple_form/templates/_form.html.slim
74
- - lib/generators/simple_form/templates/config/initializers/simple_form.rb
51
+ - lib/generators/simple_form/templates/config/initializers/simple_form.rb.tt
75
52
  - lib/generators/simple_form/templates/config/locales/simple_form.en.yml
76
- - lib/simple_form.rb
53
+ - lib/generators/simple_form/templates/README
54
+ - lib/generators/simple_form/USAGE
77
55
  - lib/simple_form/action_view_extensions/builder.rb
78
56
  - lib/simple_form/action_view_extensions/form_helper.rb
79
- - lib/simple_form/components.rb
80
57
  - lib/simple_form/components/errors.rb
81
58
  - lib/simple_form/components/hints.rb
59
+ - lib/simple_form/components/html5.rb
82
60
  - lib/simple_form/components/label_input.rb
83
61
  - lib/simple_form/components/labels.rb
62
+ - lib/simple_form/components/maxlength.rb
63
+ - lib/simple_form/components/min_max.rb
64
+ - lib/simple_form/components/pattern.rb
84
65
  - lib/simple_form/components/placeholders.rb
85
- - lib/simple_form/components/wrapper.rb
66
+ - lib/simple_form/components/readonly.rb
67
+ - lib/simple_form/components.rb
68
+ - lib/simple_form/core_ext/hash.rb
86
69
  - lib/simple_form/error_notification.rb
87
70
  - lib/simple_form/form_builder.rb
88
- - lib/simple_form/helpers.rb
89
- - lib/simple_form/helpers/has_errors.rb
90
- - lib/simple_form/helpers/maxlength.rb
91
- - lib/simple_form/helpers/pattern.rb
71
+ - lib/simple_form/helpers/autofocus.rb
72
+ - lib/simple_form/helpers/disabled.rb
73
+ - lib/simple_form/helpers/readonly.rb
92
74
  - lib/simple_form/helpers/required.rb
93
75
  - lib/simple_form/helpers/validators.rb
76
+ - lib/simple_form/helpers.rb
94
77
  - lib/simple_form/i18n_cache.rb
95
- - lib/simple_form/inputs.rb
96
78
  - lib/simple_form/inputs/base.rb
97
79
  - lib/simple_form/inputs/block_input.rb
98
80
  - lib/simple_form/inputs/boolean_input.rb
81
+ - lib/simple_form/inputs/collection_check_boxes_input.rb
99
82
  - lib/simple_form/inputs/collection_input.rb
83
+ - lib/simple_form/inputs/collection_radio_buttons_input.rb
84
+ - lib/simple_form/inputs/collection_select_input.rb
100
85
  - lib/simple_form/inputs/date_time_input.rb
101
86
  - lib/simple_form/inputs/file_input.rb
87
+ - lib/simple_form/inputs/grouped_collection_select_input.rb
102
88
  - lib/simple_form/inputs/hidden_input.rb
103
89
  - lib/simple_form/inputs/numeric_input.rb
104
90
  - lib/simple_form/inputs/password_input.rb
@@ -106,73 +92,112 @@ files:
106
92
  - lib/simple_form/inputs/range_input.rb
107
93
  - lib/simple_form/inputs/string_input.rb
108
94
  - lib/simple_form/inputs/text_input.rb
95
+ - lib/simple_form/inputs.rb
109
96
  - lib/simple_form/map_type.rb
110
97
  - lib/simple_form/version.rb
111
- - simple_form.gemspec
98
+ - lib/simple_form/wrappers/builder.rb
99
+ - lib/simple_form/wrappers/many.rb
100
+ - lib/simple_form/wrappers/root.rb
101
+ - lib/simple_form/wrappers/single.rb
102
+ - lib/simple_form/wrappers.rb
103
+ - lib/simple_form.rb
112
104
  - test/action_view_extensions/builder_test.rb
113
105
  - test/action_view_extensions/form_helper_test.rb
114
- - test/components/error_test.rb
115
- - test/components/hint_test.rb
116
106
  - test/components/label_test.rb
117
- - test/components/wrapper_test.rb
118
- - test/custom_components.rb
119
- - test/discovery_inputs.rb
120
- - test/error_notification_test.rb
121
- - test/form_builder_test.rb
122
- - test/inputs_test.rb
107
+ - test/form_builder/association_test.rb
108
+ - test/form_builder/button_test.rb
109
+ - test/form_builder/error_notification_test.rb
110
+ - test/form_builder/error_test.rb
111
+ - test/form_builder/general_test.rb
112
+ - test/form_builder/hint_test.rb
113
+ - test/form_builder/input_field_test.rb
114
+ - test/form_builder/label_test.rb
115
+ - test/form_builder/wrapper_test.rb
116
+ - test/generators/simple_form_generator_test.rb
117
+ - test/inputs/boolean_input_test.rb
118
+ - test/inputs/collection_check_boxes_input_test.rb
119
+ - test/inputs/collection_radio_buttons_input_test.rb
120
+ - test/inputs/collection_select_input_test.rb
121
+ - test/inputs/datetime_input_test.rb
122
+ - test/inputs/disabled_test.rb
123
+ - test/inputs/discovery_test.rb
124
+ - test/inputs/file_input_test.rb
125
+ - test/inputs/general_test.rb
126
+ - test/inputs/grouped_collection_select_input_test.rb
127
+ - test/inputs/hidden_input_test.rb
128
+ - test/inputs/numeric_input_test.rb
129
+ - test/inputs/priority_input_test.rb
130
+ - test/inputs/readonly_test.rb
131
+ - test/inputs/required_test.rb
132
+ - test/inputs/string_input_test.rb
133
+ - test/inputs/text_input_test.rb
123
134
  - test/simple_form_test.rb
135
+ - test/support/discovery_inputs.rb
124
136
  - test/support/misc_helpers.rb
125
137
  - test/support/mock_controller.rb
126
138
  - test/support/mock_response.rb
127
139
  - test/support/models.rb
128
140
  - test/test_helper.rb
129
- has_rdoc: true
130
141
  homepage: http://github.com/plataformatec/simple_form
131
142
  licenses: []
132
-
133
143
  post_install_message:
134
144
  rdoc_options: []
135
-
136
- require_paths:
145
+ require_paths:
137
146
  - lib
138
- required_ruby_version: !ruby/object:Gem::Requirement
147
+ required_ruby_version: !ruby/object:Gem::Requirement
139
148
  none: false
140
- requirements:
141
- - - ">="
142
- - !ruby/object:Gem::Version
143
- hash: 3
144
- segments:
149
+ requirements:
150
+ - - ! '>='
151
+ - !ruby/object:Gem::Version
152
+ version: '0'
153
+ segments:
145
154
  - 0
146
- version: "0"
147
- required_rubygems_version: !ruby/object:Gem::Requirement
155
+ hash: 4387068606574862378
156
+ required_rubygems_version: !ruby/object:Gem::Requirement
148
157
  none: false
149
- requirements:
150
- - - ">="
151
- - !ruby/object:Gem::Version
152
- hash: 3
153
- segments:
154
- - 0
155
- version: "0"
158
+ requirements:
159
+ - - ! '>'
160
+ - !ruby/object:Gem::Version
161
+ version: 1.3.1
156
162
  requirements: []
157
-
158
163
  rubyforge_project: simple_form
159
- rubygems_version: 1.6.2
164
+ rubygems_version: 1.8.11
160
165
  signing_key:
161
166
  specification_version: 3
162
167
  summary: Forms made easy!
163
- test_files:
168
+ test_files:
164
169
  - test/action_view_extensions/builder_test.rb
165
170
  - test/action_view_extensions/form_helper_test.rb
166
- - test/components/error_test.rb
167
- - test/components/hint_test.rb
168
171
  - test/components/label_test.rb
169
- - test/components/wrapper_test.rb
170
- - test/custom_components.rb
171
- - test/discovery_inputs.rb
172
- - test/error_notification_test.rb
173
- - test/form_builder_test.rb
174
- - test/inputs_test.rb
172
+ - test/form_builder/association_test.rb
173
+ - test/form_builder/button_test.rb
174
+ - test/form_builder/error_notification_test.rb
175
+ - test/form_builder/error_test.rb
176
+ - test/form_builder/general_test.rb
177
+ - test/form_builder/hint_test.rb
178
+ - test/form_builder/input_field_test.rb
179
+ - test/form_builder/label_test.rb
180
+ - test/form_builder/wrapper_test.rb
181
+ - test/generators/simple_form_generator_test.rb
182
+ - test/inputs/boolean_input_test.rb
183
+ - test/inputs/collection_check_boxes_input_test.rb
184
+ - test/inputs/collection_radio_buttons_input_test.rb
185
+ - test/inputs/collection_select_input_test.rb
186
+ - test/inputs/datetime_input_test.rb
187
+ - test/inputs/disabled_test.rb
188
+ - test/inputs/discovery_test.rb
189
+ - test/inputs/file_input_test.rb
190
+ - test/inputs/general_test.rb
191
+ - test/inputs/grouped_collection_select_input_test.rb
192
+ - test/inputs/hidden_input_test.rb
193
+ - test/inputs/numeric_input_test.rb
194
+ - test/inputs/priority_input_test.rb
195
+ - test/inputs/readonly_test.rb
196
+ - test/inputs/required_test.rb
197
+ - test/inputs/string_input_test.rb
198
+ - test/inputs/text_input_test.rb
175
199
  - test/simple_form_test.rb
200
+ - test/support/discovery_inputs.rb
176
201
  - test/support/misc_helpers.rb
177
202
  - test/support/mock_controller.rb
178
203
  - test/support/mock_response.rb