Created: 2008-10-27 13:49
Updated: 2017-06-04 02:33


Paperclip with Hobo

Install this plugin alongside paperclip.

It adds two small things:

  • Automatically declares the fields for you, so you can just add

     has_attached_file :photo

    to your model, and then run the migration generator. All options are automatically passed on to paperclip's has_attached_file.

  • Declares an input field

     <def tag="input" for="Paperclip::Attachment">
       <%= file_field_tag param_name_for_this, attributes %>

    (to get this, you need <include src="paperclip" plugin="paperclip_with_hobo"/> in application.dryml)


Paperclip's official repository ( has a bug (at the time of writing) that makes paperclip with hobo crash (see

But we can use a fork which is nicely patched. Add this to your Gemfile:

gem 'paperclip', :git => "git://", :branch => "master"

Update your bundle:


Install paperclip_with_hobo:

rails plugin install git://

Include the paperclip_with-hobo taglib in your application.dryml

<include src="paperclip" plugin="paperclip_with_hobo"/>

Add paperclip to one of your models:

has_attached_file :photo

Your default form for the model will now include the four attributes added by has_attached_file. To actually allow uploading, you will need to manually add the attachment field (photo in the above example) to your form, and don't forget to add the multipart attribute:

<extend tag="form" for="MyModel">
  <old-form merge multipart>
    <field-list: fields="photo, other-fields, ..."/>

Important Note

The name of the plugin is important. It doesn't have to be paperclip_with_hobo but it will only work if this plugin loads after paperclip itself. Calling it paperclip_something is a good way to ensure that.

Cookies help us deliver our services. By using our services, you agree to our use of cookies Learn more