tablatom / paperclip_with_hobo

A few simple extensions to the Paperclip plugin that make it even easier to add file attachment in a Hobo app

This URL has Read+Write access

GertThiel (author)
Wed Feb 18 11:15:48 -0800 2009
tablatom (committer)
Fri Jul 31 03:50:33 -0700 2009
name age message
file README.markdown Loading commit data...
file init.rb Wed Feb 18 11:15:48 -0800 2009 * Added an updated at field * Changed type of f... [GertThiel]
directory taglibs/ Mon Oct 27 06:50:33 -0700 2008 Initial import [tablatom]
README.markdown

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

  • Declares an input field

    <def tag="input" for="Paperclip::Attachment">
      <%= file_field_tag param_name_for_this, attributes %>
    </def>
    
    (to get this, you need <include src="paperclip" plugin="paperclip_with_hobo"/> in application.dryml)

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.