simple-form-builder 0.0.6.rails3 → 0.0.7.rails3

Sign up to get free protection for your applications and to get access to all the features.
@@ -208,15 +208,19 @@ module SimpleFormBuilder
208
208
 
209
209
  dom_class = sfb_options[:label_class] || method
210
210
 
211
- label_options = {:class => dom_class }
211
+ tag = ActionView::Helpers::InstanceTag.new(
212
+ object_name, method, self, object
213
+ )
214
+
215
+ label_options = { :class => dom_class }
216
+
212
217
  if @options[:index].present?
213
218
  # We're making our own label for attribute
214
- label_options[:for] = "#{object.class.to_s.downcase.pluralize}_#{@options[:index]}_#{method.to_s.downcase}"
219
+ label_options[:for] = tag.send(:tag_id_with_index, @options[:index])
215
220
  end
221
+
222
+ tag = tag.to_label_tag(text.html_safe, label_options)
216
223
 
217
- tag = ActionView::Helpers::InstanceTag.new(
218
- object_name, method, self, object
219
- ).to_label_tag(text.html_safe, label_options)
220
224
 
221
225
  if hint = sfb_options[:hint]
222
226
  tag + " <span class='hint'>#{hint}</span>".html_safe
@@ -1,3 +1,3 @@
1
1
  module SimpleFormBuilder
2
- VERSION = '0.0.6.rails3'
2
+ VERSION = '0.0.7.rails3'
3
3
  end
metadata CHANGED
@@ -1,15 +1,15 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: simple-form-builder
3
3
  version: !ruby/object:Gem::Version
4
- hash: 708262357
4
+ hash: 708262365
5
5
  prerelease: 6
6
6
  segments:
7
7
  - 0
8
8
  - 0
9
- - 6
9
+ - 7
10
10
  - rails
11
11
  - 3
12
- version: 0.0.6.rails3
12
+ version: 0.0.7.rails3
13
13
  platform: ruby
14
14
  authors:
15
15
  - Ben Askins
@@ -17,7 +17,7 @@ autorequire:
17
17
  bindir: bin
18
18
  cert_chain: []
19
19
 
20
- date: 2011-04-05 00:00:00 +10:00
20
+ date: 2011-05-31 00:00:00 +10:00
21
21
  default_executable:
22
22
  dependencies: []
23
23