Module: EasyTable::ViewExt::Row
- Defined in:
- lib/easy-table/row/data.rb,
lib/easy-table/row.rb
Defined Under Namespace
Modules: Data
Instance Method Summary collapse
- #render_footer(footer, headers) ⇒ Object
- #render_header(heads) ⇒ Object
- #row(object, options = {}, &block) ⇒ Object
Instance Method Details
#render_footer(footer, headers) ⇒ Object
17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 |
# File 'lib/easy-table/row.rb', line 17 def , headers size = case headers when Fixnum headers when Array headers.size else raise ArgumentError, "Must take a 2nd argument that indicates number of columns the footer should span" end return nil if .blank? indent_tag 1, :tfoot do indent_tag 2, :tr do indent_tag(3, :th, , :colspan => size).indent 2 end.indent(1) end.html_safe end |
#render_header(heads) ⇒ Object
7 8 9 10 11 12 13 14 15 |
# File 'lib/easy-table/row.rb', line 7 def render_header heads return nil if heads.empty? indent_tag 1, :thead do indent_tag 2, :tr do header_row heads end.indent 1 end.html_safe end |
#row(object, options = {}, &block) ⇒ Object
34 35 36 37 |
# File 'lib/easy-table/row.rb', line 34 def row object, ={}, &block content = with_output_buffer { yield object } indent_tag(2, :tr, content, ).html_safe end |