title: Using Rails with Paperclip and SWFUpload
body: <p>I have a basic rails application test with a user model that has a photo field handled with paperclip. I created the views to be able to create/edit an user and the photo uploading is working nicely. </p>
  
  <pre><code>&lt;h1&gt;Editing user&lt;/h1&gt;
  
  &lt;% form_for :user, @user, :url =&gt; user_path(@user), :html =&gt; { :method =&gt; "put", :multipart =&gt; true } do |f| %&gt;
    &lt;%= f.error_messages %&gt;
  
    &lt;p&gt;
      &lt;%= f.label :first_name %&gt;&lt;br /&gt;
      &lt;%= f.text_field :first_name %&gt;
    &lt;/p&gt;
    &lt;p&gt;
      &lt;%= f.label :last_name %&gt;&lt;br /&gt;
      &lt;%= f.text_field :last_name %&gt;
    &lt;/p&gt;
    &lt;p&gt;
      &lt;%= f.label :file %&gt;&lt;br /&gt;
      &lt;%= f.file_field :file %&gt;
    &lt;/p&gt;
  
    &lt;p&gt;
      &lt;%= f.label :photo %&gt;&lt;br /&gt;
      &lt;%= f.file_field :photo %&gt;
    &lt;p&gt;
      &lt;%= f.submit 'Update' %&gt;
    &lt;/p&gt;
  
  &lt;% end %&gt;
  
  &lt;%= link_to 'Show', @user %&gt; |
  &lt;%= link_to 'Back', users_path %&gt;
  </code></pre>
  
  <p>Then, I wanted to integrate SWFUpload in my application. I tried to follow this <a href="http://jimneath.org/2008/05/15/swfupload-paperclip-and-ruby-on-rails/" rel="nofollow noreferrer">tutorial</a> and run the <a href="http://jimneath.org/wp-content/uploads/2008/05/swfupload1.zip" rel="nofollow noreferrer">test project</a> without any success: the browse button doesn't open a file dialog and an error #2176 is threw which is about the selectFiles() method. </p>
  
  <p>First, the problem is about Flash v.10 that isn't compatible with the old version of SWFUpload (2.1.0) included with the project : selectFiles() is now deprecated. So I tried to upgrade to SWFUpload v. 2.2.0 which now use a button_placeholder_id setting but I can't get any example to work.</p>
  
  <p>So i'm a bit lost about how to use SWFUpload initialization and about and to use it in my form so I can upload and save a photo. Any helps?</p>