Attachment_fu: can't disable :partition option

Posted by Nathan Long on Stack Overflow See other posts from Stack Overflow or by Nathan Long
Published on 2010-02-28T20:53:10Z Indexed on 2010/05/17 5:10 UTC
Read the original article Hit count: 245

I'm trying to use the Attachment_Fu plugin in a Rails project, and want to customize the paths where uploaded files are saved.

The documentation shows this option:

:partition # Whether to partiton files in directories like /0000/0001/image.jpg. Default is true.

(The 0001 part is an ID from a table.) I don't want that, so I set the partition option to false, like so:

class Photo < ActiveRecord::Base
  has_attachment :content_type => :image,
                 :storage => :file_system,
                 :max_size => 500.kilobytes,
                 :resize_to => '320x200',
                 :thumbnails => {:thumb => '100x100>' },
                 :partition => false
  validates_as_attachment
end

...but the :partition => false option has no effect.

Has anybody else encountered this problem? How did you fix it?

© Stack Overflow or respective owner

Related posts about ruby-on-rails

Related posts about attachment-fu