Skip to content

Commit

Permalink
#32 show tag with dummy links
Browse files Browse the repository at this point in the history
  • Loading branch information
ohliumliu committed May 25, 2016
1 parent a89cbaf commit 96f5ab0
Show file tree
Hide file tree
Showing 2 changed files with 12 additions and 1 deletion.
11 changes: 11 additions & 0 deletions app/helpers/tags_helper.rb
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
module TagsHelper
def show_tags(video)
tags = video.tags.map {|t| t.name}
tags_link = []
tags.join(" ")
tags.each do |t|
tags_link.append(link_to t, "#")
end
tags_link.join(" ")
end
end
2 changes: 1 addition & 1 deletion app/views/videos/index.html.erb
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
<span><%= t(:view_count, default: "views") %>: <%= video.view_count %></span>
<span><%= t(:likes, default: "likes") %>: <%= video.like_count %></span>
<span><%= t(:favorite, default: "favorite") %>: <%= video.favorite_count %></span>
<span><%= t(:tags, default: "tags") %>: <%= video.tags.map {|t| t.name + " "} %></span>
<span><%= t(:tags, default: "tags") %>: <%= raw(show_tags(video)) %></span>
</p>
</div>
</div>
Expand Down

0 comments on commit 96f5ab0

Please sign in to comment.