Changeset 730
- Timestamp:
- 10/08/07 01:30:56 (1 year ago)
- Files:
-
- plugins/merb_helpers/lib/form_helpers.rb (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/merb_helpers/lib/form_helpers.rb
r729 r730 20 20 def form_for(obj, &block) 21 21 concat("<form>", block.binding) 22 self.instance_eval do 23 @obj = instance_variable_get("@#{obj}") 24 @object_name = obj 25 @block = block 26 block.call 27 end 28 concat("</form>", block.binding) 22 23 old_obj, @_obj = @_obj, instance_variable_get("@#{obj}") 24 @_object_name = obj 25 old_block, @_block = @_block, block 26 27 block.call 28 29 concat("</form>", block.binding) 30 @_obj, @_block = old_obj, old_block 29 31 end 30 32 31 33 def text_control(col) 32 concat("<input type='text' name='#{@ object_name}[#{col}]' value='#{@obj.send(col)}'/>", @block.binding)34 concat("<input type='text' name='#{@_object_name}[#{col}]' value='#{@_obj.send(col)}'/>", @_block.binding) 33 35 end 34 36
