# Selecting from a large pool of items

**URL:** <https://www.ruby-forum.com/t/selecting-from-a-large-pool-of-items/177775>\
**Category:** Rails\
**Created:** [October 23, 2009, 3:40pm UTC](https://www.ruby-forum.com/t/selecting-from-a-large-pool-of-items/177775 "2009-10-23T15:40:49Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![RVince](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/4491bb/32.png) [@RVince](https://www.ruby-forum.com/u/RVince)\
**Post date:** [October 23, 2009, 3:40pm UTC](https://www.ruby-forum.com/t/selecting-from-a-large-pool-of-items/177775/1 "2009-10-23T15:40:49Z")

</div>

I have a redbox with a form in it and one of the controls in the form  
would typically be a select box. However, in my select box, I want to  
include every role in a given table as options, and that could get  
monstrously large and hence impact load time.

In a web 2.0 world, it seems the ideal solution is an autocomplete  
text box – and in most instances this solves the problem wonderfully.  
However, this functionality I cannot get to work when embedded in a  
form in a redbox.

So my question then is if anyone can direct me to another means (other  
than the kludgy, select box with thousands of records!) that I can  
accomplish a selection without using a select box – or, of minimizing  
the records in the select box so as to make this workable. Are there  
any other html controls I can use? What do people use when they have  
thousands of options to select from? Thanks, Rvince

---

<div class="post-metadata">

**Author:** ![RVince](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/4491bb/32.png) [@RVince](https://www.ruby-forum.com/u/RVince)\
**Post date:** [October 23, 2009, 8:24pm UTC](https://www.ruby-forum.com/t/selecting-from-a-large-pool-of-items/177775/2 "2009-10-23T20:24:59Z")

</div>

RVince wrote:

> I have a redbox with a form in it and one of the controls in the form  
> would typically be a select box. However, in my select box, I want to  
> include every role in a given table as options, and that could get  
> monstrously large and hence impact load time.
> 
> In a web 2.0 world, it seems the ideal solution is an autocomplete  
> text box – and in most instances this solves the problem wonderfully.  
> However, this functionality I cannot get to work when embedded in a  
> form in a redbox.

Have you used Firebug or similar to figure out what’s going on? It  
should be possible to get the two working together.

> So my question then is if anyone can direct me to another means (other  
> than the kludgy, select box with thousands of records!) that I can  
> accomplish a selection without using a select box – or, of minimizing  
> the records in the select box so as to make this workable. Are there  
> any other html controls I can use? What do people use when they have  
> thousands of options to select from? Thanks, Rvince

Well, you might consider a “poor man’s autocomplete”: present a search  
box, and (possibly with Ajax) display a couple of possible results,  
based on what the user typed in the search box. Kind of like what  
[railsapi.com](http://railsapi.com) does.

It’s also worth remembering that Safari and Firefox both jump directly  
to a row in a select box if you type the first few letters. IE doesn’t  
(it only looks at the first letter), but then IE sucks anyway. 😃

## Best,

Marnen Laibow-Koser  
[http://www.marnen.org](http://www.marnen.org)  
removed\_email\_address@domain.invalid

---

<div class="post-metadata">

**Author:** ![RVince](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/r/4491bb/32.png) [@RVince](https://www.ruby-forum.com/u/RVince)\
**Post date:** [October 24, 2009, 1:40am UTC](https://www.ruby-forum.com/t/selecting-from-a-large-pool-of-items/177775/3 "2009-10-24T01:40:55Z")

</div>

On Fri, Oct 23, 2009 at 6:39 AM, RVince [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> What do people use when they have thousands of options to select from?

They step back and redefine the problem, because “selecting from  
thousands of options” is not the correct answer to anything 🙂

–  
Hassan S. ------------------------ removed\_email\_address@domain.invalid  
twitter: @hassan
