# Adding to select list

**URL:** <https://www.ruby-forum.com/t/adding-to-select-list/156251>\
**Category:** Rails\
**Created:** [December 23, 2008, 2:34pm UTC](https://www.ruby-forum.com/t/adding-to-select-list/156251 "2008-12-23T14:34:35Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![parki](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/b782af/32.png) [@parki](https://www.ruby-forum.com/u/parki)\
**Post date:** [December 23, 2008, 2:34pm UTC](https://www.ruby-forum.com/t/adding-to-select-list/156251/1 "2008-12-23T14:34:35Z")

</div>

I have several select lists on a form generated via collection\_select  
pulling values from the database. What I would like to do is, if new  
components need to be added to a select list (new options), I am  
providing a link beside the select list which will pop-up a small form  
to add a new item to the list. Upon saving the new item, I would like  
the list on the form (parent window) to refresh, so that the new item  
can be selected. I have tried both opener.location.reload(), which  
updates the lists but unfortanately wipes out all fields on the form,  
and window.opener.history.go(0), which keeps the field values, but does  
not refresh the select lists as needed. Any suggestions on how I can  
accomplish this? TIA.

---

<div class="post-metadata">

**Author:** ![parki](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/p/b782af/32.png) [@parki](https://www.ruby-forum.com/u/parki)\
**Post date:** [December 24, 2008, 4:11pm UTC](https://www.ruby-forum.com/t/adding-to-select-list/156251/2 "2008-12-24T16:11:35Z")

</div>

How about refreshing the select list using rjs?

On Tue, Dec 23, 2008 at 3:34 PM, Brian P. \<
