`
zhtxc
  • 浏览: 1733 次
  • 性别: Icon_minigender_1
  • 来自: 北京
最近访客 更多访客>>
文章分类
社区版块
存档分类
最新评论

attachment_fu上传图片怎么没有缩略图呢

阅读更多
class Mugshot < ActiveRecord::Base
  has_attachment :content_type => :image,
    :storage => :file_system,
    :processor => :MiniMagick,
    :max_size => 10.megabytes,  
    :resize_to => '320*200',
    :thumbnails => { :thumb => [50, 50] },
    :path_prefix => 'public/images/mugshots'
    
  validates_as_attachment

end



<h1>New mugshot</h1>


<%= error_messages_for :mugshot %>

<% form_for(:mugshot, :url => mugshots_path,
                      :html => { :multipart => true }) do |f| -%>
  <p>
    <label for="mugshot">Upload A Mugshot:</label>
    <%= f.file_field :uploaded_data %>
  </p>
  <p>
    <%= submit_tag 'Create' %>
  </p>
<% end -%>




<%= link_to 'New mugshot', new_mugshot_path %>

<h1>Most Wanted</h1>
<% for mugshot in @mugshots -%>
  <%= link_to image_tag(mugshot.public_filename(:thumb)), mugshot.public_filename %>
<% end -%>



那个高手帮我看看怎么回事??
分享到:
评论

相关推荐

Global site tag (gtag.js) - Google Analytics