public
Fork of justinfrench/formtastic
Description: A Rails Form Builder with semantically rich and accessible markup. It's not production ready yet, but I want it to be!
Clone URL: git://github.com/markmansour/formtastic.git
Search Repo:
changed embed to text
markmansour (author)
Thu Jul 24 06:51:22 -0700 2008
commit  7593483fbc35d68c89eb3485fc08bc4a2fa70422
tree    9c06ba16c6033976771a15501b4ccd36451cb1aa
parent  6af7aa6dcb4a3782b4f54ed84d2308832b7a8804
...
100
101
102
103
 
104
105
106
...
110
111
112
113
 
114
115
116
117
 
118
119
 
120
121
122
...
480
481
482
483
 
484
485
 
486
487
488
...
100
101
102
 
103
104
105
106
...
110
111
112
 
113
114
115
116
 
117
118
 
119
120
121
122
...
480
481
482
 
483
484
 
485
486
487
488
0
@@ -100,7 +100,7 @@ module JustinFrench #:nodoc:
0
         return @template.content_tag(:li, content, list_item_html_attributes(method, options))
0
       end
0
       
0
- # Returns a display onely, embedded field to be displayed within the form.
0
+ # Returns a display only, embedded field to be displayed within the form.
0
       #
0
       # Options:
0
       #
0
@@ -110,13 +110,13 @@ module JustinFrench #:nodoc:
0
       #
0
       # <% semantic_form_for @employee do |form| %>
0
       # <% form.input_field_set do -%>
0
- # <%= form.embed :name, :label => "Full Name"%>
0
+ # <%= form.text :name, :label => "Full Name"%>
0
       # <%= form.input :manager_id, :as => :radio %>
0
       # <% end %>
0
       # <% end %>
0
- def embed(method, options = {})
0
+ def text(method, options = {})
0
         options[:label] ||= method.to_s.humanize
0
- content = embed_label(method, options)
0
+ content = text_label(method, options)
0
         content += @template.content_tag(:span, object.send(method))
0
           
0
         return @template.content_tag(:li, content)
0
@@ -480,9 +480,9 @@ module JustinFrench #:nodoc:
0
         @template.label(@object_name, method, text)
0
       end
0
       
0
- alias :embed_label :input_label #:nodoc:
0
+ alias :text_label :input_label #:nodoc:
0
       
0
- def embed_text(method, options) #:nodoc:
0
+ def text_text(method, options) #:nodoc:
0
         [ options[:label], required_or_optional_string(options[:required]) ].join()
0
       end
0
       
...
63
64
65
66
 
67
68
69
...
71
72
73
74
 
75
76
77
...
63
64
65
 
66
67
68
69
...
71
72
73
 
74
75
76
77
0
@@ -63,7 +63,7 @@ describe 'Formtastic' do
0
     end
0
   end
0
   
0
- describe '#embed' do
0
+ describe '#text' do
0
     it 'generates a field with a label' do
0
       @post = mock('post')
0
       @post.stub!(:title).and_return('hello')
0
@@ -71,7 +71,7 @@ describe 'Formtastic' do
0
       @post.stub!(:column_for_attribute).and_return(mock('column', :type => :string, :limit => 255))
0
       _erbout = ''
0
       semantic_form_for(:post, @post, :url => '/hello') do |builder|
0
- _erbout += builder.embed :title
0
+ _erbout += builder.text :title
0
       end
0
       _erbout.should have_xpath("form/li/label")
0
       _erbout.should match_xpath("form/li/span", "hello")

Comments

    No one has commented yet.