Kiss A simpler, smarter web application framework for Ruby

Kiss::Form::SelectField Subclass of Kiss::Form::MultiChoiceField

Methods

Public Instance Methods

element_html() source

Not documented

    # File lib/kiss/form/field.rb, line 307
      def element_html
        return 'No options' unless @options.size > 0
        
        placeholder_html = %Q(<option value="">Choose Here</option>)
        
        options_html = option_pairs.map do |value,display|
          selected = (@value.to_s == value.to_s) ? ' selected' : ''
          %Q(<option value="#{value_to_s(value)}"#{selected}>#{display}</option>)
        end.join
        
        content_tag_html('select', placeholder_html + options_html) + other_field_html
      end
    

Disabled; run with $DEBUG to generate this.