generic_form_builder 0.1.0 → 0.1.2
Sign up to get free protection for your applications and to get access to all the features.
- data/README.md +8 -0
- data/generic_form_builder.gemspec +2 -2
- data/lib/generic_form_builder.rb +6 -1
- metadata +4 -3
data/README.md
ADDED
@@ -1,11 +1,11 @@
|
|
1
1
|
# -*- encoding: utf-8 -*-
|
2
2
|
Gem::Specification.new do |s|
|
3
3
|
s.name = "generic_form_builder"
|
4
|
-
s.version = '0.1.
|
4
|
+
s.version = '0.1.2'
|
5
5
|
s.platform = Gem::Platform::RUBY
|
6
6
|
s.authors = ["Elliot Crosby-McCullough", "George Brocklehurst", "Elise Huard", "Tom Stuart"]
|
7
7
|
s.email = ["elliot.cm@gmail.com"]
|
8
|
-
s.homepage = ""
|
8
|
+
s.homepage = "http://github.com/elliotcm/generic_form_builder"
|
9
9
|
s.summary = "Generic Rails 3 form builder"
|
10
10
|
s.files = `git ls-files`.split("\n")
|
11
11
|
s.require_paths = ["lib"]
|
data/lib/generic_form_builder.rb
CHANGED
@@ -14,10 +14,15 @@ class GenericFormBuilder < ActionView::Helpers::FormBuilder
|
|
14
14
|
note = content_tag(:span, options[:note], :class => 'note') if options[:note]
|
15
15
|
button = ' '+content_tag(:button, content_tag(:span, options[:button])) if options[:button]
|
16
16
|
errors = ' '+@object.errors[field].join(' and ') if @object.errors[field].any?
|
17
|
-
content_tag(:p, label(field, "#{options[:label]}#{errors}") + note + super(field, *args) + button.try(:html_safe))
|
17
|
+
content_tag(:p, label(field, "#{options[:label]}#{errors}") + note + super(field, options, *args) + button.try(:html_safe))
|
18
18
|
end
|
19
19
|
end
|
20
20
|
|
21
|
+
def select(field, collection, options = {})
|
22
|
+
label_text = options[:label] || field.to_s.humanize
|
23
|
+
content_tag(:p, label(field, "#{label_text} #{errors_text(field)}") + super)
|
24
|
+
end
|
25
|
+
|
21
26
|
def collection_select(field, collection, value_method, name_method, options = {})
|
22
27
|
label_text = options[:label] || field.to_s.humanize
|
23
28
|
content_tag(:p, label(field, "#{label_text} #{errors_text(field)}") + super(field, collection, value_method, name_method))
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: generic_form_builder
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.1.
|
4
|
+
version: 0.1.2
|
5
5
|
prerelease:
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
@@ -12,7 +12,7 @@ authors:
|
|
12
12
|
autorequire:
|
13
13
|
bindir: bin
|
14
14
|
cert_chain: []
|
15
|
-
date: 2012-01-
|
15
|
+
date: 2012-01-27 00:00:00.000000000Z
|
16
16
|
dependencies: []
|
17
17
|
description:
|
18
18
|
email:
|
@@ -21,9 +21,10 @@ executables: []
|
|
21
21
|
extensions: []
|
22
22
|
extra_rdoc_files: []
|
23
23
|
files:
|
24
|
+
- README.md
|
24
25
|
- generic_form_builder.gemspec
|
25
26
|
- lib/generic_form_builder.rb
|
26
|
-
homepage:
|
27
|
+
homepage: http://github.com/elliotcm/generic_form_builder
|
27
28
|
licenses: []
|
28
29
|
post_install_message:
|
29
30
|
rdoc_options: []
|