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.