Changeset 729
- Timestamp:
- 10/08/07 01:24:27 (1 year ago)
- Files:
-
- plugins/merb_helpers/lib/form_helpers.rb (modified) (2 diffs)
- plugins/merb_helpers/specs/merb_helpers_spec.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/merb_helpers/lib/form_helpers.rb
r710 r729 19 19 20 20 def form_for(obj, &block) 21 concat("<form>", block.binding) 21 22 self.instance_eval do 22 23 @obj = instance_variable_get("@#{obj}") … … 25 26 block.call 26 27 end 27 c apture(block)28 concat("</form>", block.binding) 28 29 end 29 30 plugins/merb_helpers/specs/merb_helpers_spec.rb
r710 r729 58 58 before :each do 59 59 @obj = FakeModel.new 60 def _buffer(buf) @buffer ||= "" end 60 61 end 61 62 62 63 it "should take a string object and return a useful text control" do 63 64 f = form_for :obj do 64 text_control(:foo).should == "< input type='text' name='obj[foo]' value='foowee'/>"65 text_control(:foo).should == "<form><input type='text' name='obj[foo]' value='foowee'/>" 65 66 end 66 f.should == " ..."67 f.should == "<form><input type='text' name='obj[foo]' value='foowee'/></form>" 67 68 end 68 69
