0

How can i easily entegrate swfupload to my application?

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

Photo model

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"

photos controller

  def create
    @photo = current_user.photos.build(params[:photo])
      if @photo.save
        redirect_to(@photo)
      else
        render :action => "new"
      end
  end
cocoa
  • 35
  • 1
  • 4

1 Answers1

0

I made two apps here: https://github.com/apneadiving/Pic-upload---Crop-in-Ajax

  • with jQuery upload

  • with swfupload

They could be good examples

apneadiving
  • 114,565
  • 26
  • 219
  • 213