0
我想将我的图像变成链接。但是如何?我读了不同的答案,但没有奏效。导轨,将图像变为链接
<%= 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.