neorails-form_fu 0.41 → 0.51
Sign up to get free protection for your applications and to get access to all the features.
- data/form_fu.gemspec +2 -2
- data/lib/form_fu/form_builder.rb +4 -3
- data/lib/form_fu/helpers.rb +5 -2
- metadata +2 -2
data/form_fu.gemspec
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.name = 'form_fu'
|
3
|
-
s.version = '0.
|
4
|
-
s.date = '2008-07-
|
3
|
+
s.version = '0.51'
|
4
|
+
s.date = '2008-07-09'
|
5
5
|
|
6
6
|
s.summary = "Build Nice DRY Rails Forms"
|
7
7
|
s.description = "FormFu is a Rails plugin that enables you to easily build nice, tableless forms"
|
data/lib/form_fu/form_builder.rb
CHANGED
@@ -95,13 +95,14 @@ module FormFu
|
|
95
95
|
output_html = @template.field_tag(options[:field], [
|
96
96
|
@template.label(@object_name, field, label_name),
|
97
97
|
tag_output,
|
98
|
-
@template.
|
99
|
-
|
98
|
+
block_given? ? @template.capture(&block) : nil,
|
99
|
+
@template.validation_tag(@object, field)
|
100
100
|
].compact.join("\n"))
|
101
101
|
|
102
102
|
if block_given?
|
103
103
|
# concat to page if block was given
|
104
|
-
|
104
|
+
@template.concat(output_html, block.binding)
|
105
|
+
return nil
|
105
106
|
else
|
106
107
|
# otherwise return html directly
|
107
108
|
return output_html
|
data/lib/form_fu/helpers.rb
CHANGED
@@ -1,10 +1,13 @@
|
|
1
1
|
module FormFu
|
2
2
|
module Helpers
|
3
3
|
# Create a form_for block using FormFuBuilder
|
4
|
-
def formfu_for(record_or_name_or_array, *args, &
|
4
|
+
def formfu_for(record_or_name_or_array, *args, &block)
|
5
|
+
raise ArgumentError, "Missing block" unless block_given?
|
6
|
+
|
5
7
|
options = args.extract_options!
|
6
8
|
args << options.merge(:builder => FormFu::FormBuilder)
|
7
|
-
form_for(record_or_name_or_array, *args, &
|
9
|
+
form_for(record_or_name_or_array, *args, &block)
|
10
|
+
|
8
11
|
end
|
9
12
|
|
10
13
|
# also work with the more semantic name (build_form_for)
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: neorails-form_fu
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: "0.
|
4
|
+
version: "0.51"
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Tyler Crocker
|
@@ -9,7 +9,7 @@ autorequire:
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2008-07-
|
12
|
+
date: 2008-07-09 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|