Skip to content
No description or website provided.
Ruby
Find file
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.
lib
MIT-LICENSE
README
Rakefile
init.rb
install.rb
uninstall.rb

README

TableFu
=================

Gives you a handy set of helpers to do advanced table views


Basic usage
===========

<%= table(@events) %>

Outputs:

<table>
  <%= render :partial => "events/table_head" %>
  <%= render :partial => "events/table_row", :collection => @events %>
</table>


<%= table(@events, :class => "list") %>

Outputs:

<table class="list">
  <%= render :partial => "events/table_head" %>
  <%= render :partial => "events/table_row", :collection => @events %>
</table>


Advanced usage
==============

# _table_head.html.erb
<tr>
  <%= th :name %>
  <%= th :description, "Info" %>
</tr>

# _table_row.html.erb
<tr>
  <%= td :name, object.name %>
  <% td :description do %>
    <%= textilize(object.description) %>
  <% end %>
</tr>

# index.html.erb

<%= table(@events, :class => "list", :ignore_columns => [:description]) %>



Copyright (c) 2008 [Beamer Wilkins], released under the MIT license
Something went wrong with that request. Please try again.