Skip to content
A few simple extensions to the Paperclip plugin that make it even easier to add file attachment in a Hobo app
Find file
New pull request
Pull request Compare This branch is 5 commits ahead, 2 commits behind tslocke:master.
Fetching latest commit...
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


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)


Install paperclip:

ruby script/plugin install git://

Install paperclip_with_hobo

ruby script/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.

Something went wrong with that request. Please try again.