simple_form 1.0.0 → 1.0.1
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.
- data/README.rdoc +1 -5
- data/generators/simple_form_install/templates/simple_form.rb +10 -12
- data/lib/simple_form.rb +2 -2
- data/lib/simple_form/action_view_extensions/instance_tag.rb +2 -2
- data/lib/simple_form/components/labels.rb +2 -1
- data/lib/simple_form/inputs/base.rb +2 -2
- data/lib/simple_form/version.rb +1 -1
- metadata +34 -5
data/README.rdoc
CHANGED
@@ -8,7 +8,7 @@ SimpleForm aims to be as flexible as possible while helping you with powerful co
|
|
8
8
|
|
9
9
|
Install the gem:
|
10
10
|
|
11
|
-
sudo gem install simple_form --version=1.0
|
11
|
+
sudo gem install simple_form --version=1.0.1
|
12
12
|
|
13
13
|
Configure simple_form gem inside your app:
|
14
14
|
|
@@ -324,10 +324,6 @@ SimpleForm has several configuration values. You can read and change them in the
|
|
324
324
|
|
325
325
|
ruby script/generate simple_form_install
|
326
326
|
|
327
|
-
== TODO
|
328
|
-
|
329
|
-
Please refer to TODO file.
|
330
|
-
|
331
327
|
== Maintainers
|
332
328
|
|
333
329
|
* José Valim (http://github.com/josevalim)
|
@@ -5,18 +5,16 @@ SimpleForm.setup do |config|
|
|
5
5
|
# remove any of them, change the order, or even add your own components in the
|
6
6
|
# stack. By inheriting your component from SimpleForm::Components::Base you'll
|
7
7
|
# have some extra helpers for free.
|
8
|
-
# config.components = [
|
9
|
-
|
10
|
-
#
|
11
|
-
#
|
12
|
-
|
13
|
-
|
14
|
-
#
|
15
|
-
|
16
|
-
#
|
17
|
-
|
18
|
-
# You can wrap all inputs in a pre-defined tag. By default is nil.
|
19
|
-
# config.wrapper_tag = nil
|
8
|
+
# config.components = [ :label, :input, :hint, :error ]
|
9
|
+
|
10
|
+
# Default tag used on hints.
|
11
|
+
# config.hint_tag = :span
|
12
|
+
|
13
|
+
# Default tag used on errors.
|
14
|
+
# config.error_tag = :span
|
15
|
+
|
16
|
+
# You can wrap all inputs in a pre-defined tag.
|
17
|
+
# config.wrapper_tag = :div
|
20
18
|
|
21
19
|
# How the label text should be generated altogether with the required text.
|
22
20
|
# config.label_text = lambda { |label, required| "#{required} #{label}" }
|
data/lib/simple_form.rb
CHANGED
@@ -9,11 +9,11 @@ module SimpleForm
|
|
9
9
|
autoload :Inputs, 'simple_form/inputs'
|
10
10
|
autoload :MapType, 'simple_form/map_type'
|
11
11
|
|
12
|
-
# Default tag used
|
12
|
+
# Default tag used on hints.
|
13
13
|
mattr_accessor :hint_tag
|
14
14
|
@@hint_tag = :span
|
15
15
|
|
16
|
-
# Default tag used
|
16
|
+
# Default tag used on errors.
|
17
17
|
mattr_accessor :error_tag
|
18
18
|
@@error_tag = :span
|
19
19
|
|
@@ -27,11 +27,11 @@ module SimpleForm
|
|
27
27
|
checkbox = tag("input", options)
|
28
28
|
|
29
29
|
result = hidden + checkbox
|
30
|
-
result.respond_to?(:html_safe
|
30
|
+
result.respond_to?(:html_safe) ? result.html_safe : result
|
31
31
|
end
|
32
32
|
end
|
33
33
|
end
|
34
34
|
end
|
35
35
|
|
36
36
|
ActionView::Helpers::InstanceTag.send :remove_method, :to_check_box_tag
|
37
|
-
ActionView::Helpers::InstanceTag.send :include, SimpleForm::ActionViewExtensions::InstanceTag
|
37
|
+
ActionView::Helpers::InstanceTag.send :include, SimpleForm::ActionViewExtensions::InstanceTag
|
@@ -28,7 +28,8 @@ module SimpleForm
|
|
28
28
|
end
|
29
29
|
|
30
30
|
def label_text
|
31
|
-
SimpleForm.label_text.call(raw_label_text, required_label_text)
|
31
|
+
result = SimpleForm.label_text.call(raw_label_text, required_label_text)
|
32
|
+
result.respond_to?(:html_safe) ? result.html_safe : result
|
32
33
|
end
|
33
34
|
|
34
35
|
def label_target
|
data/lib/simple_form/version.rb
CHANGED
metadata
CHANGED
@@ -1,7 +1,13 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: simple_form
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
|
4
|
+
hash: 21
|
5
|
+
prerelease: false
|
6
|
+
segments:
|
7
|
+
- 1
|
8
|
+
- 0
|
9
|
+
- 1
|
10
|
+
version: 1.0.1
|
5
11
|
platform: ruby
|
6
12
|
authors:
|
7
13
|
- "Jos\xC3\xA9 Valim"
|
@@ -10,7 +16,7 @@ autorequire:
|
|
10
16
|
bindir: bin
|
11
17
|
cert_chain: []
|
12
18
|
|
13
|
-
date: 2010-
|
19
|
+
date: 2010-07-01 00:00:00 +02:00
|
14
20
|
default_executable:
|
15
21
|
dependencies: []
|
16
22
|
|
@@ -51,6 +57,23 @@ files:
|
|
51
57
|
- lib/simple_form/map_type.rb
|
52
58
|
- lib/simple_form/version.rb
|
53
59
|
- README.rdoc
|
60
|
+
- test/action_view_extensions/builder_test.rb
|
61
|
+
- test/action_view_extensions/form_helper_test.rb
|
62
|
+
- test/components/error_test.rb
|
63
|
+
- test/components/hint_test.rb
|
64
|
+
- test/components/label_test.rb
|
65
|
+
- test/form_builder_test.rb
|
66
|
+
- test/inputs_test.rb
|
67
|
+
- test/simple_form_test.rb
|
68
|
+
- test/support/country_select/init.rb
|
69
|
+
- test/support/country_select/install.rb
|
70
|
+
- test/support/country_select/lib/country_select.rb
|
71
|
+
- test/support/country_select/uninstall.rb
|
72
|
+
- test/support/misc_helpers.rb
|
73
|
+
- test/support/mock_controller.rb
|
74
|
+
- test/support/mock_response.rb
|
75
|
+
- test/support/models.rb
|
76
|
+
- test/test_helper.rb
|
54
77
|
has_rdoc: true
|
55
78
|
homepage: http://github.com/plataformatec/simple_form
|
56
79
|
licenses: []
|
@@ -61,21 +84,27 @@ rdoc_options:
|
|
61
84
|
require_paths:
|
62
85
|
- lib
|
63
86
|
required_ruby_version: !ruby/object:Gem::Requirement
|
87
|
+
none: false
|
64
88
|
requirements:
|
65
89
|
- - ">="
|
66
90
|
- !ruby/object:Gem::Version
|
91
|
+
hash: 3
|
92
|
+
segments:
|
93
|
+
- 0
|
67
94
|
version: "0"
|
68
|
-
version:
|
69
95
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
96
|
+
none: false
|
70
97
|
requirements:
|
71
98
|
- - ">="
|
72
99
|
- !ruby/object:Gem::Version
|
100
|
+
hash: 3
|
101
|
+
segments:
|
102
|
+
- 0
|
73
103
|
version: "0"
|
74
|
-
version:
|
75
104
|
requirements: []
|
76
105
|
|
77
106
|
rubyforge_project:
|
78
|
-
rubygems_version: 1.3.
|
107
|
+
rubygems_version: 1.3.7
|
79
108
|
signing_key:
|
80
109
|
specification_version: 3
|
81
110
|
summary: Forms made easy!
|