Skip to content

Commit

Permalink
Add usage instructions for row classes [jgdavey#21, jgdavey#24]
Browse files Browse the repository at this point in the history
  • Loading branch information
jesjos committed Mar 21, 2013
1 parent f024c74 commit 964a7fd
Showing 1 changed file with 16 additions and 0 deletions.
16 changes: 16 additions & 0 deletions README.rdoc
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,22 @@ will product html like:
</tbody>
</table>

For that last extra squeeze of micro-management, you can use the data block to customize row classes with a block:
<%= table_for(@posts) do |t|
t.data do
t.row_class { |post| post.title }
end
end %>

Or with a string
<%= table_for(@posts) do |t|
t.data do
t.row_class("foobar")
end
end %>




If it _still_ isn't flexible enough for your needs, it might be time to return to static html/erb.

Expand Down

0 comments on commit 964a7fd

Please sign in to comment.