Skip to content

Instantly share code, notes, and snippets.

@wildjcrt
Created March 11, 2010 12:33
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wildjcrt/329094 to your computer and use it in GitHub Desktop.
Save wildjcrt/329094 to your computer and use it in GitHub Desktop.
<%= render_table(@games,
[
["ID", lambda { |p| p.id }],
["遊戲名稱", lambda { |p| p.name }],
["標籤", lambda { |p| p.tag_list.join(" | ") }],
["動作", lambda { |p|
add_to_favorites_status_bar(p) + ' | ' +
unless current_user
link_to("Show", game_path(p)) + ' | ' +
end
link_to("Edit", edit_game_path(p)) + ' | ' +
link_to("Delete", game_path(p), :confirm => "Are you sure?", :method => :delete )
}]
],
:class_name => "table")
%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment