Attachment_fu + :path_prefix

Hello friends,
I have a query like I am using a attchment_fu to store images.
But the i don’t want to store to the default path let say :path_prefix
=>
‘public/uploads’ i want a dyname path for e.g :path_prefix => ‘public/#{
current_user.id}’, So just wanted to know how can i say images to the
dynamic location.

Regards
Abhishek S.

‘public/uploads’ i want a dyname path for e.g :path_prefix => ‘public/#{
current_user.id}’,

Have you tried this like

:path_prefix => “public/#{> current_user.id}”

 Instead of single quotes use double quotes

Sijo

:path_prefix => “public/#{current_user.id}”

Ok great things are working fine. but again i have a major concern when
I am
declaring it like

:path_prefix => “public/user_#{current_user.id}”

in background it save the image in the following folder structure

“public/user_/123/_image.jpg”

And i am looking something like

“public/user_123/_image.jpg”

Actually it’s creating a just “user_” folder which i don;t want, i want
to
have “user_123”.

Thanks
Abhis

On Thu, Jul 30, 2009 at 1:12 PM, Sijo Kg

Give
:storage => :file_system,
:path_prefix => “public/user_#{current_user.id}”

Sijo

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs