显示在图像旁边的Rails 4回形针哈希值

时间:2014-01-29 08:05:38

标签: ruby-on-rails paperclip

我是Rails 4的新手。我已经安装了paperclip gem并且可以成功保存图像。但是,当我显示图像时,我看到图像旁边显示的哈希值。我怎样才能摆脱哈希值?

下面是哈希值和我的HTML代码

> [#<Upload id: 18, project_id: 17, attachment_file_name:
> "fb_icon_325x325.png",  attachment_content_type: "image/png",
> attachment_file_size: 4822, attachment_updated_at:  "2014-01-29
> 05:53:36", created_at: "2014-01-29 05:53:38",  updated_at: "2014-01-29
> 05:53:38">]

<%= @projects.uploads.each do |u| %>
    <%= link_to image_tag(u.attachment.url(:thumb)), u.attachment.url(:original) %>
<% end %>

1 个答案:

答案 0 :(得分:2)

您只需要删除第一行的=

<% @projects.uploads.each do |u| %>
   <%= link_to image_tag(u.attachment.url(:thumb)), u.attachment.url(:original) %>
<% end %>

希望这有帮助