# Letting a user choose pictures

**URL:** <https://www.ruby-forum.com/t/letting-a-user-choose-pictures/150208>\
**Category:** Rails\
**Created:** [October 6, 2008, 3:24am UTC](https://www.ruby-forum.com/t/letting-a-user-choose-pictures/150208 "2008-10-06T03:24:25Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![stimpy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/779978/32.png) [@stimpy](https://www.ruby-forum.com/u/stimpy)\
**Post date:** [October 6, 2008, 3:24am UTC](https://www.ruby-forum.com/t/letting-a-user-choose-pictures/150208/1 "2008-10-06T03:24:25Z")

</div>

I have an area on a site where a user can upload pictures to, and then  
another area in which they create a new topic. Now I want a user to be  
able to select photos from their uploaded photos… and I’ve hit a  
coder’s block. Any tips on designing this interface?

---

<div class="post-metadata">

**Author:** ![stimpy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/779978/32.png) [@stimpy](https://www.ruby-forum.com/u/stimpy)\
**Post date:** [October 6, 2008, 2:29pm UTC](https://www.ruby-forum.com/t/letting-a-user-choose-pictures/150208/2 "2008-10-06T14:29:20Z")

</div>

What’s exactly the question?

You have images, records with information about those images (path,  
name…)  
and all you need to do is show a list with this information.

Just get the image records as you would do with any other kind of  
record.  
Paginate if necessary and then display in a list or table.  
(You may want to use thumbnails instead of fullsized images)  
Main difference is that you have an additional image tag or link to  
click the image for selecting it. (I would make that an Ajax response)

Then you action gets the images id (and user id or whatever)  
and can assign it to any other subset or blogentry or whatever  
you want to do with it.

Have a look at this site: www.nationalebeeldbank.nl

It’s doing something on that line, querying images with sphinx  
and allow to add them to a cart or view the fullsize version.  
(No need to create a user, searching images works without  
registration)

---

<div class="post-metadata">

**Author:** ![stimpy](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/779978/32.png) [@stimpy](https://www.ruby-forum.com/u/stimpy)\
**Post date:** [October 7, 2008, 1:34am UTC](https://www.ruby-forum.com/t/letting-a-user-choose-pictures/150208/3 "2008-10-07T01:34:31Z")

</div>

A user can upload an arbitrary number of images to the site and then  
there’s a section where they can create topics for forums of the site.  
I would like the user to be able to select images from this list and  
attach them to a topic and I’m not sure of how to design the UI for  
that.
