Clicking to add content is adding it outside of the page's table

Each time the “add” button in my nested form is clicked, it adds the
partial to the end of the page, not inside in the table.

My view file:

<% echantillon_form.fields_for :treatments do |builder| %> <%= render :partial => "treatment_fields", :locals => {:f => builder} %> <% end %>
  <%= link_to_add_fields "Add treatment",

echantillon_form, :treatments %>

  <%= echantillon_form.submit "Submit" %>
  <% end %>

My partial:

<%= f.label(:treatmenttype, "type de traitement") %> <%= f.text_field :treatmenttype %> <%= f.label(:treatmenttype, "commentaires sur la preparation") %> <%= f.text_field :preparation %> <%= f.hidden_field :_destroy %> <%= link_to_remove_fields "remove", f %>

On Mon, Apr 12, 2010 at 9:24 AM, ES [email protected] wrote:

Each time the “add” button in my nested form is clicked, it adds the
partial to the end of the page, not inside in the table.

 <%= echantillon_form.submit "Submit" %>
 <% end %>

My partial:

<%= f.label(:treatmenttype, "type de traitement") %>

A DIV can’t be a child of TBODY; lose those tags and it’ll probably
work.


Hassan S. ------------------------ [email protected]
twitter: @hassan

So what can be a child of div? I’ve tried p and that still places the
new content it outside the table. I have a div encompassing the
entire page so that it can be formatted with my leftcontainer side
menu. What tag can I use to insert the html content successfully into
the table in the page?

On Apr 12, 6:38 pm, Hassan S. [email protected]

On Mon, Apr 12, 2010 at 9:50 AM, ES [email protected] wrote:

So what can be a child of div? I’ve tried p and that still places the
new content it outside the table. I have a div encompassing the
entire page so that it can be formatted with my leftcontainer side
menu.

That’s fine but irrelevant – the only child of TBODY is TR.

My partial:

So lose this div and just have your TR rows there.


Hassan S. ------------------------ [email protected]
twitter: @hassan

On 12 April 2010 18:14, Hassan S. [email protected]
wrote:

So lose this div and just have your TR rows there.

It is also not valid to wrap rows or cells in a form. The form must
wrap the whole table or fit completely within one cell. As I posted
in a separate thread check the html using firefox html validator
or/and the w3c html validator website.

Colin