2011-03-23 72 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

回答