Replace_html problem


#1

Hi - trying to update a table with page.replace_html using a partial:

The view (index.html.erb):

[code=]


<%= render :partial => ‘product’ %>
[/code] The partial (_product.html.erb) [code=] <% for product in @products %> <% end %>
<%= product.name %> <%= product.vendor.name %>
[/code] The actual update: [code=]render :update do |page| page.replace_html 'prod_table', :partial => 'product' end[/code] I'm getting most of the page back, but the table is messed up, showing with a lot of \n\n characters (the javascript just shows up on the screen): try { Element.update("prod_table", " \n\n \n \nProduct 1 \nVendor 1\n \n \nProduct 2 \nVendor 2\n \n \nProduct 3 \nVendor 3\n .. \n\n "); } catch(e){ alert('RJS error:\n\n' + e.toString()); alert('Element.update(\"prod_table\",\" \\n \\n\\n ... and then the whole table again as a long string (it renders the error message on the screen.

What could be the problem?