Sha256: 65886febb0be9ef17d600980319b226ca254b1dde31f738683bdf1584c22fd75

Contents?: true

Size: 513 Bytes

Versions: 7

Compression:

Stored size: 513 Bytes

Contents

# frozen_string_literal: true

# Adds a (by default submit) button
#
# == Basic usage:
#    {%select name:'group'%}{%endselect%}
#
# == Advanced usage:
#    {%select group%}{%endselect%}
#
class SelectTag < LiquidumBlock
  def render(context)
    super

    %[<select] + attr_str(:name, arg(:name), input(:name, argv1)) +
      attr_str(:id, arg(:id), input(:id, argv1)) +
      attrs_str(reject: %[name id]) +
      %[>] + render_body + %[</select>]
  end
end

Liquid::Template.register_tag('select', SelectTag)

Version data entries

7 entries across 7 versions & 1 rubygems

Version Path
scribo-1.0.44 lib/scribo/liquid/tags/select_tag.rb
scribo-1.0.43 lib/scribo/liquid/tags/select_tag.rb
scribo-1.0.42 lib/scribo/liquid/tags/select_tag.rb
scribo-1.0.41 lib/scribo/liquid/tags/select_tag.rb
scribo-1.0.40 lib/scribo/liquid/tags/select_tag.rb
scribo-1.0.39 lib/scribo/liquid/tags/select_tag.rb
scribo-1.0.38 lib/scribo/liquid/tags/select_tag.rb