【发布时间】:2013-04-21 16:11:35
【问题描述】:
我想把我的图片变成一个链接。但是怎么做?我阅读了不同的答案,但没有任何效果。
<%= link_to image_tag(article.images.first.image.url, :alt => article.title) unless
article.images.first.nil? %>
我使用此链接按标题引用文章。
<%= link_to(article) do %><h2><%= article.title %></h2><% end %>
This works! the path. But i want the same path "article" with the image.
【问题讨论】:
标签: ruby-on-rails image hyperlink