Skip to content

Instantly share code, notes, and snippets.

@wildjcrt
Created March 11, 2010 12:31
Show Gist options
  • Save wildjcrt/329090 to your computer and use it in GitHub Desktop.
Save wildjcrt/329090 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|
if current_user
add_to_favorites_status_bar(p) + ' | ' +
link_to("Show", game_path(p)) + ' | ' +
link_to("Edit", edit_game_path(p)) + ' | ' +
link_to("Delete", game_path(p), :confirm => "Are you sure?", :method => :delete )
else
link_to("Show", game_path(p))
end
}]
],
:class_name => "table")
%>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment