bootstraps_bootstraps 2.0.1 → 2.0.2
Sign up to get free protection for your applications and to get access to all the features.
- data/lib/bootstraps_bootstraps/bootstrap_form_builder.rb +11 -5
- data/lib/version.rb +1 -1
- metadata +3 -3
@@ -51,8 +51,9 @@ module BootstrapsBootstraps
|
|
51
51
|
|
52
52
|
errors, error_msg = render_errors name
|
53
53
|
|
54
|
-
label_options = options
|
54
|
+
label_options = options.clone
|
55
55
|
label_options[:class] = options[:label_class] unless options[:label_class].nil?
|
56
|
+
guarantee_html_class label_options, 'control-label'
|
56
57
|
label = options[:label] == false ? ''.html_safe : field_label(name, label_options)
|
57
58
|
|
58
59
|
guarantee_html_class options
|
@@ -101,7 +102,10 @@ module BootstrapsBootstraps
|
|
101
102
|
|
102
103
|
errors, error_msg = render_errors method
|
103
104
|
|
104
|
-
|
105
|
+
label_options = html_options.clone
|
106
|
+
guarantee_html_class label_options, 'control-label'
|
107
|
+
name = options[:label] || method
|
108
|
+
label = options[:label] == false ? ''.html_safe : field_label(options[:label], label_options)
|
105
109
|
|
106
110
|
guarantee_html_class options
|
107
111
|
options[:class].push 'input-xlarge' if options[:large]
|
@@ -133,7 +137,10 @@ module BootstrapsBootstraps
|
|
133
137
|
#hmm, apparently TODO
|
134
138
|
help_text options
|
135
139
|
|
136
|
-
|
140
|
+
label_options = html_options.clone
|
141
|
+
label_options[:class] = ['control-label']
|
142
|
+
#guarantee_html_class label_options, 'control-label'
|
143
|
+
label = options[:label] == false ? ''.html_safe : field_label(method, label_options)
|
137
144
|
|
138
145
|
guarantee_html_class html_options, 'inline'
|
139
146
|
|
@@ -200,8 +207,7 @@ module BootstrapsBootstraps
|
|
200
207
|
|
201
208
|
private
|
202
209
|
|
203
|
-
def field_label(name,
|
204
|
-
options = args.extract_options!
|
210
|
+
def field_label(name, options = {}, &block)
|
205
211
|
guarantee_html_class options
|
206
212
|
clss = options[:class]
|
207
213
|
clss.push 'required' if object.class.validators_on(name).any? { |v| v.kind_of? ActiveModel::Validations::PresenceValidator}
|
data/lib/version.rb
CHANGED
metadata
CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
|
|
5
5
|
segments:
|
6
6
|
- 2
|
7
7
|
- 0
|
8
|
-
-
|
9
|
-
version: 2.0.
|
8
|
+
- 2
|
9
|
+
version: 2.0.2
|
10
10
|
platform: ruby
|
11
11
|
authors:
|
12
12
|
- Robert L. Carpenter
|
@@ -14,7 +14,7 @@ autorequire:
|
|
14
14
|
bindir: bin
|
15
15
|
cert_chain: []
|
16
16
|
|
17
|
-
date: 2012-03-
|
17
|
+
date: 2012-03-30 00:00:00 -06:00
|
18
18
|
default_executable:
|
19
19
|
dependencies: []
|
20
20
|
|