lib/html-native/collections.rb
# Converts the DropdownComponent instance to the equivalent HTML. 
#
# *render* can be called directly, but that usually isn't necessary.
# HTMLComponent::Builder handles this automatically, so it only needs to be 
# done if there is no prior instance of one.
Converts the DropdownComponent instance to the equivalent HTML.
render* can be called directly, but that usually isn't necessary.
HTMLComponent::Builder handles this automatically, so it only needs to be
done if there is no prior instance of one.
Converts the DropdownComponent instance to the equivalent HTML . render * can be called directly but that usually isn ' t necessary . HTMLComponent :: Builder handles this automatically so it only needs to be done if there is no prior instance of one .
def render
    select(@menu_attributes.merge({name: @name, id: "#{@name}-dropdown"})) do
      @choices.component_map do |c|
        option(@item_attributes.merge({value: c})) {@block ? @block.call(c) : c}
      end
    end
  end
def render select ( @menu_attributes . merge ( { name : @name , id : "#{@name}-dropdown" } ) ) do @choices . component_map do | c | option ( @item_attributes . merge ( { value : c } ) ) { @block ? @block . call ( c ) : c } end end end
Converts the DropdownComponent instance to the equivalent HTML.
Converts the DropdownComponent instance to the equivalent HTML .