2011-03-23 96 views
0

如何轻松地将swfupload集成到我的应用程序中?swfupload +回形针+导轨3

<%= form_for(@photo, :html => { :multipart => true }) do |f| %> 
<%= f.text_field :title %> 
<%= f.file_field :attachment %> 
<%= f.submit "Upload" %> 
<% end %> 

照片模式

has_attached_file :attachment, 
        :styles => { :small => "200x100", :big => "500x300>" }, 
        :url => "/images/attachments/:id/:style/:basename.:extension", 
       :path => "#{::Rails.root.to_s}/public/images/attachments/:id/:style/:basename.:extension" 

照片控制器

def create 
    @photo = current_user.photos.build(params[:photo]) 
     if @photo.save 
     redirect_to(@photo) 
     else 
     render :action => "new" 
     end 
    end 
+0

问题被问过:http://stackoverflow.com/questions/900769/using-rails-with-paperclip-and-swfupload – 2011-03-23 15:08:59

+0

这个问题不是Rails 3 – Noz 2012-06-28 21:15:46

回答