4-10-2010
Rails form_for() :multipart
In Ruby on Rails you can set :multipart => true on form_tag() and it will return a form tag with the proper enctype for uploading files. However, you can't use :multipart directly on form_for().
The work around is to set enctype directly to the :html of the fom_for():
form_for(@post, :html => {:enctype => "multipart/form-data"})Which will return something like:
<form action="/posts" enctype="multipart/form-data" method="post">[...]