neorails-form_fu 0.4 → 0.5
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.
- data/form_fu.gemspec +2 -2
- data/lib/form_fu/form_builder.rb +2 -1
- 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.5'
|
4
|
+
s.date = '2008-07-07'
|
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
@@ -101,7 +101,8 @@ module FormFu
|
|
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.5"
|
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-07 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies:
|
15
15
|
- !ruby/object:Gem::Dependency
|