Skip to content

Instantly share code, notes, and snippets.

@tal
Created November 4, 2012 05:59
Show Gist options
  • Select an option

  • Save tal/4010504 to your computer and use it in GitHub Desktop.

Select an option

Save tal/4010504 to your computer and use it in GitHub Desktop.
Proposed table api
<%= table_for(@users) do |user| %>
<% column '', user.class.to_s.first %>
<% column 'ID', link_to(user.id, admin_user_path(user)) %>
<% column 'Name', user.name %>
<% column 'Email', user.email.andand.key %>
<% column 'Facebook' do %>
<% if user.facebook %>
<%= link_to user.facebook.key, "https://facebook.com/#{user.facebook.key}", target: "_blank" %>
<%= 'token' if user.facebook.access_token %>
<% end %>
<% end %>
<% end %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment