# Repopulate select on partial render

**URL:** <https://www.ruby-forum.com/t/repopulate-select-on-partial-render/174940>\
**Category:** Rails\
**Created:** [September 4, 2009, 1:08pm UTC](https://www.ruby-forum.com/t/repopulate-select-on-partial-render/174940 "2009-09-04T13:08:59Z")\
**Posts on this page:** 1\
**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:** [September 4, 2009, 1:08pm UTC](https://www.ruby-forum.com/t/repopulate-select-on-partial-render/174940/1 "2009-09-04T13:08:59Z")

</div>

I am adding data to a table (for my Channelnotes model) in my  
ChannelsController. in my /view/channels I have a partial (shown  
below) that creates a select of the most recent three entries in this  
table. It works perfectly when the page is initially loaded.

However, when I add an entry into the table of the Channelnotes model  
(in my channels controller, which it does correctly, thanks to the  
guys on this list) and I go to redraw the partial (to repopulate the  
select with the most recent three Channelnote entries) it doesn;t  
repopulate the list. Shouln;t the select helper in the enclosed  
partial get invoked on a replace or render partial? I have tried  
invoking this after saving the the new Channelnote with either:

render :partial =\> ‘channelnotesfield’

or

render :update do |div|  
div.replace ‘notesdiv’ , :partial =\> ‘channelnotesfield’  
end

Neither of which repopulate the select helper in the channelnotesfield  
helper shown below. I’ve looked at it up and down in firebug, and just  
dont see anything failing here. Is this the correct behavior? If so,  
how can I make that select repopulate after a controller action? Thx,  
RVince

Notes: \<%= select("channelnotes", "channelnotes", Channelnote.find (:all, :order =\> 'tstamp DESC', :limit =\>3, :conditions =\> ["deleted=0"]).collect {|p| [p.note, p.note]}, { :include\_blank =\> true , :selected=\>0, :value=\>""},{}) %\> \<%= observe\_field "channelnotes", :url =\> {:controller =\> :channels, :action =\> 'notesboxchange' }, :frequency =\> 1.0, :with =\> "'channelnotes=' + value" %\>
