simple_form 1.2.1 → 1.2.2
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.
|
@@ -96,25 +96,27 @@ module SimpleForm
|
|
|
96
96
|
fields_for(*(args << options), &block)
|
|
97
97
|
end
|
|
98
98
|
|
|
99
|
-
|
|
99
|
+
private
|
|
100
100
|
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
[:checked, :disabled].each do |option|
|
|
106
|
-
next unless options[option]
|
|
101
|
+
# Generate default options for collection helpers, such as :checked and
|
|
102
|
+
# :disabled.
|
|
103
|
+
def default_html_options_for_collection(item, value, options, html_options) #:nodoc:
|
|
104
|
+
html_options = html_options.dup
|
|
107
105
|
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
else
|
|
111
|
-
Array(options[option]).include?(value)
|
|
112
|
-
end
|
|
106
|
+
[:checked, :disabled].each do |option|
|
|
107
|
+
next unless options[option]
|
|
113
108
|
|
|
114
|
-
|
|
115
|
-
|
|
109
|
+
accept = if options[option].is_a?(Proc)
|
|
110
|
+
options[option].call(item)
|
|
111
|
+
else
|
|
112
|
+
Array(options[option]).include?(value)
|
|
116
113
|
end
|
|
114
|
+
|
|
115
|
+
html_options[option] = true if accept
|
|
117
116
|
end
|
|
117
|
+
|
|
118
|
+
html_options
|
|
119
|
+
end
|
|
118
120
|
end
|
|
119
121
|
end
|
|
120
122
|
end
|
|
@@ -147,7 +147,7 @@ module SimpleForm
|
|
|
147
147
|
:conditions => @reflection.options[:conditions], :order => @reflection.options[:order]
|
|
148
148
|
)
|
|
149
149
|
|
|
150
|
-
|
|
150
|
+
input(attribute, options).tap { @reflection = nil }
|
|
151
151
|
end
|
|
152
152
|
|
|
153
153
|
# Creates a button:
|
data/lib/simple_form/version.rb
CHANGED
metadata
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
|
2
2
|
name: simple_form
|
|
3
3
|
version: !ruby/object:Gem::Version
|
|
4
|
-
hash:
|
|
4
|
+
hash: 27
|
|
5
5
|
prerelease: false
|
|
6
6
|
segments:
|
|
7
7
|
- 1
|
|
8
8
|
- 2
|
|
9
|
-
-
|
|
10
|
-
version: 1.2.
|
|
9
|
+
- 2
|
|
10
|
+
version: 1.2.2
|
|
11
11
|
platform: ruby
|
|
12
12
|
authors:
|
|
13
13
|
- "Jos\xC3\xA9 Valim"
|
|
@@ -16,7 +16,7 @@ autorequire:
|
|
|
16
16
|
bindir: bin
|
|
17
17
|
cert_chain: []
|
|
18
18
|
|
|
19
|
-
date: 2010-07-
|
|
19
|
+
date: 2010-07-27 00:00:00 +02:00
|
|
20
20
|
default_executable:
|
|
21
21
|
dependencies: []
|
|
22
22
|
|