class HtmlGrid::Select

Private Instance Methods

selection(context) click to toggle source
# File lib/htmlgrid/select.rb, line 44
def selection(context)
  @selected ||= (@model.send(@name).to_s if @model.respond_to?(@name))
  @valid_values ||= @session.valid_values(@name)
  @valid_values.collect { |value|
    val = value.to_s
    attributes = {"value" => val}
    attributes.store("selected", true) if val == selected
    context.option(attributes) { @lookandfeel.lookup(value) { val } }
  }
end