alter :path_prefix boldly job has_attachment around tie fu plugin
by default stores uploaded files "public/#{table_name}"
. i wish cgange something "public/#{table_name}/#{site_id}"
, where site_id
ability model. note i've attempted controlling self.site_id
both fail.
has_attachment :storage => :file_system,
:max_size => 25.megabytes,
:path_prefix => "public/#{table_name}/#{site_id}",
:thumbnails => {
:large => '256x256>',
:medium => '128x128>',
:small => '64x64>'
}
i accept "undefined internal non-static slight site_id" blunder messages. stealing #{site_id}
member :path_prefix
works glorious initialize
slight run. i opening site_id
expected.
i have an initialize
slight looks this:
def initialize(site_id = nil)
super(nil)
self.site_id ||= site_id
end
i instanciate vigilant around rails console this:
r = resource.new(100)
is has_attachment
slight controlling before initialize
method? i pass parameter :path_prefix
boldly denote instantiated?
Comments
Post a Comment