Changeset 1009
- Timestamp:
- 11/16/07 01:36:39 (1 year ago)
- Files:
-
- plugins/merb_helpers/Rakefile (modified) (2 diffs)
- plugins/merb_helpers/lib/form_helpers.rb (modified) (4 diffs)
- plugins/merb_helpers/specs/merb_helpers_spec.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/merb_helpers/Rakefile
r1007 r1009 4 4 PLUGIN = "merb_helpers" 5 5 NAME = "merb_helpers" 6 VERSION = "0.4.1"6 GEM_VERSION = "0.4.1" 7 7 AUTHOR = "Yehuda Katz" 8 8 EMAIL = "wycats@gmail.com" … … 12 12 spec = Gem::Specification.new do |s| 13 13 s.name = NAME 14 s.version = VERSION14 s.version = GEM_VERSION 15 15 s.platform = Gem::Platform::RUBY 16 16 s.has_rdoc = true plugins/merb_helpers/lib/form_helpers.rb
r1006 r1009 35 35 # 36 36 # <form action="/foo/bar/1" method="post"> 37 # < input id="first_name" name="first_name" size="30" type="text" />37 # <label for="first_name">First Name</label><input id="first_name" name="first_name" size="30" type="text" /> 38 38 # <input name="commit" type="submit" value="Create" /> 39 39 # </form> … … 81 81 # 82 82 # <form action="/foo/bar/1" method="post"> 83 # < input id="first_name" name="first_name" size="30" type="text" />83 # <label for="first_name">First Name</label><input id="first_name" name="first_name" size="30" type="text" /> 84 84 # <input name="commit" type="submit" value="Create" /> 85 85 # </form> … … 103 103 # 104 104 # <form action="/people/create" method="post"> 105 # < input id="person_first_name" name="person[first_name]" size="30" type="text" />106 # < input id="person_last_name" name="person[last_name]" size="30" type="text" />105 # <label for="person[first_name]">First Name</label><input id="person_first_name" name="person[first_name]" size="30" type="text" /> 106 # <label for="person[last_name]">Last Name</label><input id="person_last_name" name="person[last_name]" size="30" type="text" /> 107 107 # <input name="commit" type="submit" value="Create" /> 108 108 # </form> … … 392 392 # ==== Options 393 393 # +legend+:: The name of this fieldset which will be provided in a HTML legend tag. 394 def fieldset(attrs ={}, &block)394 def fieldset(attrs={}, &block) 395 395 legend = attrs.delete(:legend) 396 open_tag( 'fieldset', attrs ) + ( tag('legend', legend) if legend ) + yield + "</fieldset>" 397 end 398 396 concat( open_tag('fieldset', attrs), block.binding ) 397 concat( tag('legend', legend), block.binding ) if legend 398 concat(capture(&block), block.binding) 399 concat( "</fieldset>", block.binding) 400 end 401 399 402 ## file input control 400 403 def file_control(col, attrs = {}) plugins/merb_helpers/specs/merb_helpers_spec.rb
r1006 r1009 512 512 513 513 it "should provide legend option" do 514 f orm_tagdo514 fieldset :legend => 'TEST' do 515 515 _buffer << "CONTENT" 516 516 end 517 _buffer.should match_tag(:form, :method => "post")518 517 _buffer.should include("CONTENT") 518 _buffer.should match_tag(:fieldset, {}) 519 _buffer.should match_tag(:legend, :content => 'TEST') 519 520 end 520 521 end
