I have this inside of a template where I have a remote form with the
form fields inside of a table:
 <div id='ingredients_div'>
   <%= render :partial => 'ingredients',
      :locals => {:attr => attr} %>
  </div>


my "_ingredients.html.erb" template is like so:

-----------------------------------------



<tr><td><%= link_to 'Add Ingredient', {:action =>
'add_ingredient', :id =>attr}, :remote => true %>
</td></tr>



<% attr.my_ingredients.each do |ingred| %>
  <%= fields_for 'ingredient[]',ingred do |fm| %>

 <tr><td>
        <% fld = 'del-' + ingred.id.to_s %>
        <%= check_box_tag fld %>
        <%= observe_field fld, :frequency => 0.5,
        :url => {:action => 'delete_ingredient', :id => ingred} %>
 </td></tr>
 <tr>
        <td>Name</td><td><%= fm.text_field 'ingred_name', :value =>
ingred.name %> </td>
 </tr>
 <tr>
        <td>Cas</td><td> <%= fm.text_field 'cas', :value => ingred.cas %> </
td>
 </tr>
 <tr><td>&nbsp</td></tr>
 <% end %>
<% end %>


-----------------------------

 my rjs actions try to delete/add an ingredient record or add one and
then re render
the partial like this:

page.replace_html 'ingredients_div', :partial =>
'ingredients', :locals => {:attr => attr}

 I can't remember if there is some html rule with form fields or table
rules, but the html seems to get modified as the page kind of
twitches, but the fields don't redisplay as they should. The view
source confuses me as it appears the div moved someplace else and left
the old fields intact where they where.

-- 
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 [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/rubyonrails-talk?hl=en.

Reply via email to