justinfrench-formtastic 0.2.2 → 0.2.3
Sign up to get free protection for your applications and to get access to all the features.
- data/README.textile +4 -0
- data/lib/formtastic.rb +2 -6
- data/spec/formtastic_spec.rb +2 -2
- metadata +3 -4
data/README.textile
CHANGED
@@ -418,6 +418,10 @@ If you wish, put something like this in config/initializers/formtastic_config.rb
|
|
418
418
|
# Default value: false. Overridden for specific fields by setting value to true,
|
419
419
|
# i.e. :label => true, or :hint => true (or opposite depending on initialized value)
|
420
420
|
# Formtastic::SemanticFormBuilder.i18n_lookups_by_default = false
|
421
|
+
|
422
|
+
# If you want to subclass SemanticFormBuilder to add/change the behavior to suit your needs, you
|
423
|
+
# can specify the builder class.
|
424
|
+
# Formtastic::SemanticFormHelper.builder = MyCustomBuilder
|
421
425
|
</pre>
|
422
426
|
|
423
427
|
h2. Status
|
data/lib/formtastic.rb
CHANGED
@@ -325,7 +325,7 @@ module Formtastic #:nodoc:
|
|
325
325
|
#
|
326
326
|
def semantic_fields_for(record_or_name_or_array, *args, &block)
|
327
327
|
opts = args.extract_options!
|
328
|
-
opts.merge!(:builder => Formtastic::
|
328
|
+
opts.merge!(:builder => Formtastic::SemanticFormHelper.builder)
|
329
329
|
args.push(opts)
|
330
330
|
fields_for(record_or_name_or_array, *args, &block)
|
331
331
|
end
|
@@ -1280,11 +1280,7 @@ module Formtastic #:nodoc:
|
|
1280
1280
|
#
|
1281
1281
|
module SemanticFormHelper
|
1282
1282
|
@@builder = Formtastic::SemanticFormBuilder
|
1283
|
-
|
1284
|
-
# cattr_accessor :builder
|
1285
|
-
def self.builder=(val)
|
1286
|
-
@@builder = val
|
1287
|
-
end
|
1283
|
+
mattr_accessor :builder
|
1288
1284
|
|
1289
1285
|
[:form_for, :fields_for, :form_remote_for, :remote_form_for].each do |meth|
|
1290
1286
|
src = <<-END_SRC
|
data/spec/formtastic_spec.rb
CHANGED
@@ -262,10 +262,10 @@ describe 'Formtastic' do
|
|
262
262
|
@new_post.stub!(:author).and_return(Author.new)
|
263
263
|
end
|
264
264
|
|
265
|
-
it 'yields an instance of
|
265
|
+
it 'yields an instance of SemanticFormHelper.builder' do
|
266
266
|
semantic_form_for(@new_post) do |builder|
|
267
267
|
builder.semantic_fields_for(:author) do |nested_builder|
|
268
|
-
nested_builder.class.should == Formtastic::
|
268
|
+
nested_builder.class.should == Formtastic::SemanticFormHelper.builder
|
269
269
|
end
|
270
270
|
end
|
271
271
|
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: justinfrench-formtastic
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.2.
|
4
|
+
version: 0.2.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Justin French
|
@@ -9,7 +9,7 @@ autorequire: formtastic
|
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
11
|
|
12
|
-
date: 2009-
|
12
|
+
date: 2009-09-07 00:00:00 -07:00
|
13
13
|
default_executable:
|
14
14
|
dependencies: []
|
15
15
|
|
@@ -36,7 +36,6 @@ files:
|
|
36
36
|
- spec/test_helper.rb
|
37
37
|
has_rdoc: false
|
38
38
|
homepage: http://github.com/justinfrench/formtastic/tree/master
|
39
|
-
licenses:
|
40
39
|
post_install_message:
|
41
40
|
rdoc_options:
|
42
41
|
- --charset=UTF-8
|
@@ -57,7 +56,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
57
56
|
requirements: []
|
58
57
|
|
59
58
|
rubyforge_project:
|
60
|
-
rubygems_version: 1.
|
59
|
+
rubygems_version: 1.2.0
|
61
60
|
signing_key:
|
62
61
|
specification_version: 3
|
63
62
|
summary: A Rails form builder plugin/gem with semantically rich and accessible markup
|