# How to use UploadColumn

**URL:** <https://www.ruby-forum.com/t/how-to-use-uploadcolumn/109788>\
**Category:** Rails\
**Created:** [July 19, 2007, 2:42am UTC](https://www.ruby-forum.com/t/how-to-use-uploadcolumn/109788 "2007-07-19T02:42:01Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Mister\_Yu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/22d042/32.png) [@Mister\_Yu](https://www.ruby-forum.com/u/Mister_Yu)\
**Post date:** [July 19, 2007, 2:42am UTC](https://www.ruby-forum.com/t/how-to-use-uploadcolumn/109788/1 "2007-07-19T02:42:01Z")

</div>

Hi,

I installed the plugin, but got stuck rewriting the view, from the  
homepage, it says:

If you want the actual file to be sent you need to set the encoding of  
the form to multipart. There is a convenient method in UploadColumn  
that makes this really easy, instead of your usual form\_tag  
declaration simply use upload\_form\_tag.

but how exactly to change it? i m a newbie for ROR.

my partial form looks like this, can someone help me to rewrite it?  
thanks.

\<%= error\_messages\_for :user %\>  
\<% form\_for :user do |f| -%\>

Login  
\<%= f.text\_field :login %\>

Email  
\<%= f.text\_field :email %\>

Password  
\<%= f.password\_field :password %\>

Confirm Password  
\<%= f.password\_field :password\_confirmation %\>

Upload A Mugshot: \<%= f.file\_field :avatar %\>

\<%= submit\_tag 'Sign up' %\>

\<% end -%\>

---

<div class="post-metadata">

**Author:** ![Mister\_Yu](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/m/22d042/32.png) [@Mister\_Yu](https://www.ruby-forum.com/u/Mister_Yu)\
**Post date:** [July 19, 2007, 6:37am UTC](https://www.ruby-forum.com/t/how-to-use-uploadcolumn/109788/2 "2007-07-19T06:37:28Z")

</div>

Hi,

there is no helper for form\_for in UploadColumn yet, it’ll be in the  
next version, till then you can replace

\<% form\_for :user do |f| -%\>

with

\<% form\_for( :user, :html =\> { :multipart =\> true }) do |f| %\>

that should do the trick, ugly though it is.

/Jonas
