Created
March 16, 2010 05:48
-
-
Save wildjcrt/333676 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<%= render_table(@games, | |
[ | |
["ID", lambda { |p| p.id }], | |
["遊戲名稱", lambda { |p| p.name }], | |
["標籤", lambda { |p| p.tag_list.join(" | ") }], | |
["動作", lambda { |p| index_table(p)}] | |
], | |
:class_name => "table") | |
%> | |
helper: | |
def index_table(game) | |
str = "" | |
str += link_to("Show", game_path(game)) | |
if current_user | |
str +="" + ' | ' + | |
add_to_favorites_status_bar(game) + ' | ' + | |
link_to("Edit", edit_game_path(game)) + ' | ' + | |
link_to("Delete", game_path(game), :confirm => "Are you sure?", :method => :delete ) | |
end | |
return str | |
end |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment