In my controller, I:
respond_to do |format|
format.js
end
In my rjs:
page.replace_html("source_credential_list", :partial => "source_credential_list", :object => @all_source_credentials)
or
page.replace("source_credential_list", :partial => "source_credential_list", :object => @all_source_credentials)
In my partial :(
<% fields_for(@brand_report_source_credential_key) do |ff| %>
<%= ff.select :source_credential_id , options_from_collection_for_select(@all_source_credentials,'id','credential_display_name')%>
<% end %>
From my point of view:
<span id="source_credential_list">
<%= render :partial => 'source_credential_list' %>
</span>
When I replace it, it works fine, but only once, the second time when I get a warning with a zero value, I suspect because the space has disappeared. If I do replace_html, it works, it updates the range, but it puts the actual rjs / javascript in the range, including the new select / drop down. So something like this:
Source credentials try {Element.update ("source_credential_list", "\ n \ n \ n"); } catch (e) {alert ('RJS Error: \ n \ n' + e.toString ()); alert ('Element.update (\ "source_credential_list \", \ "\ n \ n \ n \");'); throw e}
, . , - ....