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

<div id="notesdiv"  style="float: right;">
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" %>
<script>
doReset();
</script>
</div>

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Ruby 
on Rails: Talk" group.
To post to this group, send email to rubyonrails-talk@googlegroups.com
To unsubscribe from this group, send email to 
rubyonrails-talk+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to