Method: HtmlGrid::DivComposite#to_html
- Defined in:
- lib/htmlgrid/divcomposite.rb
#to_html(context) ⇒ Object
36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 |
# File 'lib/htmlgrid/divcomposite.rb', line 36 def to_html(context) res = '' @grid.each_with_index { |div, idx| res << context.div(tag_attributes(idx)) { div.flatten.inject('') { |html, item| html << if(item.respond_to?(:to_html)) item.to_html(context).force_encoding('utf-8') else item.to_s end } } } res end |