Skip to content

Instantly share code, notes, and snippets.

@xdite
Created March 4, 2010 09:14
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 1 You must be signed in to fork a gist
  • Save xdite/321561 to your computer and use it in GitHub Desktop.
Save xdite/321561 to your computer and use it in GitHub Desktop.
<%= render_table(@products,
[
["ID", lambda { |p| p.id }],
["名稱", lambda { |p| p.name }],
["動作", lambda { |p|
link_to("Show", admin_product_path(p)) + ' | ' +
link_to("Edit", edit_admin_product_path(p)) + ' | ' +
link_to("Delete", admin_product_path(p), :confirm => "Are you sure?", :method => :delete )}]
],
:class_name => "table"
) %>
<%= will_paginate @products %>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment