public
Description: A Ruby web application framework
Homepage: http://www.mackframework.com
Clone URL: git://github.com/markbates/mack.git
Click here to lend your support to: mack and make a donation at www.pledgie.com !
Added cols and rows defaults to the text_area form helper. [#19]
markbates (author)
Fri Aug 15 08:32:59 -0700 2008
commit  b9bda035ceb0ea653f83523e4660f4e45b5b2070
tree    41981b3244bb451a6f2ef8d4e6efca1e5dd79977
parent  f0d18532946d7f9d0d4106245d3836eb1ff81c3f
...
146
147
148
149
 
150
151
152
...
146
147
148
 
149
150
151
152
0
@@ -146,7 +146,7 @@ module Mack
0
       def text_area(name, *args)
0
         var = instance_variable_get("@#{name}")
0
         fe = FormElement.new(*args)
0
-        options = {:name => name, :id => name}
0
+        options = {:name => name, :id => name, :cols => 60, :rows => 20}
0
         if var.nil?
0
           value = fe.options[:value]
0
           fe.options.delete(:value)
...
199
200
201
202
 
203
204
205
206
 
207
208
209
210
211
 
 
212
213
214
215
216
 
217
218
219
...
199
200
201
 
202
203
204
205
 
206
207
208
209
 
 
210
211
212
213
214
215
 
216
217
218
219
0
@@ -199,21 +199,21 @@ describe Mack::ViewHelpers::FormHelpers do
0
   describe "text_area" do
0
     
0
     it "should create a nested text_area for a model" do
0
-      text_area(:cop, :full_name).should == %{<textarea id="cop_full_name" name="cop[full_name]">ness</textarea>}
0
+      text_area(:cop, :full_name).should == %{<textarea cols="60" id="cop_full_name" name="cop[full_name]" rows="20">ness</textarea>}
0
     end
0
     
0
     it "should create a non-nested text_area for a simple object" do
0
-      text_area(:simple).should == %{<textarea id="simple" name="simple">hi</textarea>}
0
+      text_area(:simple).should == %{<textarea cols="60" id="simple" name="simple" rows="20">hi</textarea>}
0
     end
0
     
0
     it "should create a non-nested text_area for just a symbol" do
0
-      text_area(:unknown).should == %{<textarea id="unknown" name="unknown"></textarea>}
0
-      text_area(:unknown, :value => "hi there").should == %{<textarea id="unknown" name="unknown">hi there</textarea>}
0
+      text_area(:unknown).should == %{<textarea cols="60" id="unknown" name="unknown" rows="20"></textarea>}
0
+      text_area(:unknown, :value => "hi there").should == %{<textarea cols="60" id="unknown" name="unknown" rows="20">hi there</textarea>}
0
     end
0
 
0
     it "should create a nested text_area for a model with an empty value if value is false" do
0
       @cop.full_name = nil
0
-      text_area(:cop, :full_name).should == %{<textarea id="cop_full_name" name="cop[full_name]"></textarea>}
0
+      text_area(:cop, :full_name).should == %{<textarea cols="60" id="cop_full_name" name="cop[full_name]" rows="20"></textarea>}
0
     end
0
     
0
   end

Comments