Class: CML::Tags::Radios
Constant Summary collapse
- Template =
<<-HTML.freeze {{legend}} {% for radio in radios %} {{radio}} {% endfor %} HTML
Instance Attribute Summary
Attributes inherited from CML::Tag
Instance Method Summary collapse
Methods inherited from CML::Tag
#classes, #convert, #gold=, #gold?, #initialize, #instructions, #label, #legend, #name, #prefix, #raw_label, #to_html, #to_liquid, #to_s, #validate?, #validations, #value, #wrapper, #wrapper_classes
Constructor Details
This class inherits a constructor from CML::Tag
Instance Method Details
#children ⇒ Object
15 16 17 18 19 20 21 |
# File 'lib/cml/tags/radios.rb', line 15 def children @cml.xpath("cml:radio").map do |c| c["name"] ||= name c["validates"] ||= @attrs["validates"].to_s Radio.new(c, @opts) end end |
#data ⇒ Object
11 12 13 |
# File 'lib/cml/tags/radios.rb', line 11 def data super.merge({"radios" => children}) end |