lib/table_cloth/presenters/default.rb in table_cloth-0.1.2 vs lib/table_cloth/presenters/default.rb in table_cloth-0.2.0
- old
+ new
@@ -19,10 +19,19 @@
end
end
def render_td(column, object)
td_options = column.options.delete(:td_options) || {}
- wrapper_tag(:td, column.value(object, view_context, table), td_options)
+ value = column.value(object, view_context, table)
+
+ if value.is_a?(Array)
+ options = value.pop
+ value = value.shift
+
+ td_options.update(options)
+ end
+
+ wrapper_tag(:td, value, td_options)
end
def render_header
wrapper_tag :thead do
wrapper_tag :tr do
\ No newline at end of file