# Saving the user id for thumbnails using attachment\_fu

**URL:** <https://www.ruby-forum.com/t/saving-the-user-id-for-thumbnails-using-attachment-fu/122299>\
**Category:** Rails\
**Created:** [December 6, 2007, 11:58am UTC](https://www.ruby-forum.com/t/saving-the-user-id-for-thumbnails-using-attachment-fu/122299 "2007-12-06T11:58:20Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![TTDaVeTT](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/t/91b2a8/32.png) [@TTDaVeTT](https://www.ruby-forum.com/u/TTDaVeTT)\
**Post date:** [December 6, 2007, 11:58am UTC](https://www.ruby-forum.com/t/saving-the-user-id-for-thumbnails-using-attachment-fu/122299/1 "2007-12-06T11:58:20Z")

</div>

I am using attachment\_fu to create thumbnails, and it is working  
great. However, I am have a view with all my users thumbnails  
displayed and am trying to make it so when you click on a thumbnail of  
their avatar, it shows that users profile. In order to accomplish  
this I have saved a user\_id identifier for each avatar, but the  
problem is that attachment\_fu only saves this user\_id for the main  
image and does not save it in the column for the thumbnail. So when I  
try and access the user\_id to display the corresponding profile, it  
says the user\_id is 0 and there is no user with that id. Is there any  
way to get attachment\_fu to save the user\_id to the thumbails too?  
Perhaps there is some other solution. Heres the code for the avatars  
so you can get a sense for what I am trying to do:

\<% for avatar in @avatar -%\>

\<%= link\_to image\_tag(avatar.public\_filename()), {:action =\>  
“index”, :controller =\> “users”, :user\_id =\> avatar.user\_id } %\>

\<% end %\>  
So this user\_id is 0 b/c the attachment\_fu didnt save the user\_id

Any ideas are greatly appreciated. Thanks, Dave
