Usually gems/plugins are used to to handle file uploads. My favorite one, and perhaps the most ubiquitous is Paperclip.
In your view, you'll have to tell the rails form helpers that you're uploading a file like this:
<%= form_for @model, :html => { :multipart => true } do |form| %>