# Attachment\_fu multiple uploads has\_one relationship

**URL:** <https://www.ruby-forum.com/t/attachment-fu-multiple-uploads-has-one-relationship/103287>\
**Category:** Rails\
**Created:** [May 3, 2007, 8:41pm UTC](https://www.ruby-forum.com/t/attachment-fu-multiple-uploads-has-one-relationship/103287 "2007-05-03T20:41:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![jko170](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/d07c76/32.png) [@jko170](https://www.ruby-forum.com/u/jko170)\
**Post date:** [May 3, 2007, 8:41pm UTC](https://www.ruby-forum.com/t/attachment-fu-multiple-uploads-has-one-relationship/103287/1 "2007-05-03T20:41:57Z")

</div>

I’ve got a user model that has one photo.  
I have a photo model that belongs\_to user

I followed this tutorial to have an arbitrary number of users created:  
[http://www.railsforum.com/viewtopic.php?id=1065](http://www.railsforum.com/viewtopic.php?id=1065)

I then followed this tutorial to have multiple file uploads with  
attachment\_fu:  
[http://beast.caboo.se/forums/2/topics/870#posts-2484](http://beast.caboo.se/forums/2/topics/870#posts-2484)

My parameters look correct. The photos hash has a unique key for each  
photo. The users hash has a unique key for each user. What I am trying  
to do is link/attach each photo to each user based on the two having  
the same key. I can iterate through the photos and users hash and get  
the keys but I don’t know how to compare the two.  
Anyone care to give me an idea on how I can do this with Ruby’s magic?

---

<div class="post-metadata">

**Author:** ![jko170](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/j/d07c76/32.png) [@jko170](https://www.ruby-forum.com/u/jko170)\
**Post date:** [May 3, 2007, 9:42pm UTC](https://www.ruby-forum.com/t/attachment-fu-multiple-uploads-has-one-relationship/103287/2 "2007-05-03T21:42:04Z")

</div>

scratch this post – I think this shows that I have an app design  
issue, not code issue.
