Changeset 920
- Timestamp:
- 11/09/07 08:25:30 (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
r888 r920 103 103 end 104 104 105 def radio_group_control(col, options = {}, attrs = {})105 def radio_group_control(col, options = [], attrs = {}) 106 106 errorify_field(attrs, col) 107 107 val = @_obj.send(col) 108 108 ret = "" 109 109 options.each do |opt| 110 hash = {:name => "#{@_object_name}[#{col}]", :value => opt, :label => opt} 111 hash.merge!(:selected => "selected") if val.to_s == opt.to_s 110 value, label = opt.is_a?(Hash) ? [opt[:value], opt[:label]] : [opt, opt] 111 hash = {:name => "#{@_object_name}[#{col}]", :value => value, :label => label} 112 hash.merge!(:selected => "selected") if val.to_s == value.to_s 112 113 ret << radio_field(hash) 113 114 end
