Changeset 1040
- Timestamp:
- 11/24/07 11:04:44 (11 months ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
plugins/merb_helpers/lib/merb_helpers/form_helpers.rb
r1037 r1040 441 441 ret << tag("option", '', :value => '') if blank 442 442 collection.each do |label, group| 443 ret << open_tag("optgroup", :label => label.to_s ) + options_from_collection_for_select(group, attrs) + "</optgroup>"443 ret << open_tag("optgroup", :label => label.to_s.humanize.titleize) + options_from_collection_for_select(group, attrs) + "</optgroup>" 444 444 end 445 445 end … … 448 448 value_method = attrs[:value_method] 449 449 selected_value = attrs[:selected] 450 options_for_select( 451 collection.inject([]) { |options, object| options << [ object.send(value_method), object.send(text_method) ] }, 450 451 text_method ||= :to_s 452 value_method ||= text_method 453 454 options_for_select(collection.inject([]) { |options, object| 455 options << [ object.send(value_method), object.send(text_method) ] }, 452 456 :selected => selected_value, :include_blank => blank, :prompt => prompt 453 457 )
