如何将此图像转换为链接?

时间:2011-04-06 05:55:33

标签: ruby-on-rails ruby image ruby-on-rails-3 hyperlink

这是图片:

<%= image_tag comment.user.profile.photo.url(:tiny) %>

这是链接路径:

comment.user.profile

现在我该如何将这两者结合起来?

1 个答案:

答案 0 :(得分:8)

<%= link_to image_tag(comment.user.profile.photo.url(:tiny)), comment.user.profile %>