Davi,
You need to over write
Technoweenie::Attachment_fu::Backends::FileSystemBackend#partitioned_path
to change this. To do this, just write a function in your model like
this
def partitioned_path(*args)
#what ever you want it to do
end
you should probably think hard about doing this -- especially about
directory size and scalablity. If you decide you want to, be sure to
check out the original and understand how it works before you write
anything. Hope this helps.
- Paul Saieg
On Sep 25, 12:47 pm, Davi
<davivi...-UiHwsRqXctc1RhZgQKG/ig@public.gmane.org>
wrote:> Hi all. I''ve done a little google search, but
doesn''t find anything
> (with "attachment_fu default path") that could help me in
changing
> attachment_fu''s default path.
>
> My model:
>
> [audio.rb]
> has_attachment :max_size => 20.megabytes
> has_attachment :content_type => "audio/mpeg"
> has_attachment :storage => :file_system
> has_attachment :path_prefix => "public/files
> [/audio.rb]
>
> But all my files go on been uploaded to public/files/0000/00[last
inserted
> id]/my_file_name.ext.
>
> What am I missing? I want that all my files go to public/files.
>
> Thank you very much amd sorry my poor english.
> --
> Davi Vidal
> --
> E-mail: davivi...-UiHwsRqXctc1RhZgQKG/ig@public.gmane.org
> MSN : davivi...-uAjRD0nVeow@public.gmane.org
> GTalk : davivi...-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org
> Skype : davi vidal
> ICQ : 138815296
>
> signature.asc
> 1KDownload
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---