module Padrino::Helpers::FormHelpers

def options_for_select(option_items, selected_value=nil)

Returns the options tags for a select based on the given option items
def options_for_select(option_items, selected_value=nil)
  return '' if option_items.blank?
  option_items.collect do |caption, value|
    value ||= caption
    content_tag(:option, caption, :value => value, :selected => selected_value.to_s =~ /#{value}|#{caption}/)
  end
end