From 420891317e51aeee39ed0de18e09f6b248336238 Mon Sep 17 00:00:00 2001 From: Jesper Josefsson Date: Thu, 21 Mar 2013 23:24:07 +0100 Subject: [PATCH] Add subheading for customizing row classes and tighten up examples and text [#21, #24] --- README.rdoc | 19 +++++++++---------- 1 file changed, 9 insertions(+), 10 deletions(-) diff --git a/README.rdoc b/README.rdoc index 480c052..963f17c 100644 --- a/README.rdoc +++ b/README.rdoc @@ -238,30 +238,29 @@ will product html like: -For that last extra squeeze of micro-management, you can pass in a block to customize row classes: +=== Customizing row classes + +For that last extra squeeze of micro-management, you can customize row classes by passing in a block: <%= table_for(@posts) do |t| t.row_class { |post| post.title } + t.data(:title) end %> -Or with a string: +Or just using a string: <%= table_for(@posts) do |t| t.row_class("foobar") - t.data do - t.cell(:title) - end + t.data(:title) end %> You can also choose to omit the odd and even classes: <%= table_for(@posts) do |t| - t.row_class(odd_even: false) { |post| post.title } - t.data do - t.cell(:title) - end + t.row_class("foobar", odd_even: false) + t.data(:title) end %> -In HAML you would have to use a dash instead of an equals sign: +In HAML you have to use a dash instead of an equals sign: = table_for(@posts) do |t| - t.row_class("foo")