Как я могу легко включить swfupload в свое приложение?
<%= 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