public
Description: A handy and flexible table / css form builder
Homepage: http://code.google.com/p/uber-builder/
Clone URL: git://github.com/timcharper/uber-builder.git
added div layout
timcharper (author)
Sat Sep 27 14:39:13 -0700 2008
commit  9ab84c1a89cf90c269f1158656f229566842b6d1
tree    40aca791c52f285119e25be923a798f595d64f10
parent  be2601a06ab662d2eaf94133ca9b0ff3f229a350
...
7
8
9
10
 
11
12
13
...
7
8
9
 
10
11
12
13
0
@@ -7,7 +7,7 @@ end
0
 require_whole_directory("lib/extensions")
0
 require_whole_directory("lib/bonus_form_helpers")
0
 
0
-for include_file in %w[layouts/p layouts/ul layouts/table templated_methods templated_builder static_builder]
0
+for include_file in %w[layouts/p layouts/div layouts/ul layouts/table templated_methods templated_builder static_builder]
0
   require File.join(File.dirname(__FILE__), "lib", "#{include_file}.rb")
0
 end
0
 
...
10
11
12
13
 
14
15
16
...
22
23
24
25
 
26
27
28
...
33
34
35
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
36
37
 
38
39
40
...
46
47
48
49
 
50
51
52
...
10
11
12
 
13
14
15
16
...
22
23
24
 
25
26
27
28
...
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
 
56
57
58
59
...
65
66
67
 
68
69
70
71
0
@@ -10,7 +10,7 @@ describe UberBuilder::TemplatedBuilder do
0
     @builder.extend CaptureStubMethods
0
   end
0
   
0
- it "should should output element outside of table" do
0
+ it "should output element outside of table" do
0
     output = @builder.text_field(:first_name)
0
     
0
     output.should == %!<input id="record_first_name" name="record[first_name]" size="30" type="text" value="Tim Harper" />!
0
@@ -22,7 +22,7 @@ describe UberBuilder::TemplatedBuilder do
0
   end
0
   
0
   describe "p layout" do
0
- it "should should output p and label" do
0
+ it "should output p and label" do
0
       output = @builder.p {
0
         @builder.text_field(:first_name)
0
       }
0
@@ -33,8 +33,27 @@ describe UberBuilder::TemplatedBuilder do
0
     end
0
   end
0
   
0
+ describe "div layout" do
0
+ it "should output div and label" do
0
+ output = @builder.div {
0
+ @builder.text_field(:first_name)
0
+ }
0
+ output.should include('<div>')
0
+ output.should include('<label for="record_first_name">First name:</label><br />')
0
+ output.should include(%!<input id="record_first_name" name="record[first_name]" size="30" type="text" value="Tim Harper" />!)
0
+ output.should include('</div>')
0
+ end
0
+
0
+ it "should receive :div_options" do
0
+ output = @builder.div {
0
+ @builder.text_field(:first_name, :div_options => {:class => "hello"})
0
+ }
0
+ output.should include('<div class="hello">')
0
+ end
0
+ end
0
+
0
   describe "table layout" do
0
- it "should should output table and label" do
0
+ it "should output table and label" do
0
       output = @builder.table {
0
         @builder.text_field(:first_name)
0
       }
0
@@ -46,7 +65,7 @@ describe UberBuilder::TemplatedBuilder do
0
   end
0
   
0
   describe "ul layout" do
0
- it "should should output ul and label" do
0
+ it "should output ul and label" do
0
       output = @builder.ul {
0
         @builder.text_field(:first_name)
0
       }

Comments

    No one has commented yet.