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

Clicking the “add” button in my nested form is adding the content
outside of the page’s main table, how can I get it to add the html
into the table that the link is contained in?

I followed the Railscast
http://railscasts.com/episodes/197-nested-model-form-part-2

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 %>

and 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 %>

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs