You need to nest the table content inside <tr><td> ... </td></tr>
tags. It's not valid HTML otherwise.

Regards,

Ryan

On Apr 12, 7:53 am, ES <[email protected]> wrote:
> I'm following this nested forms 
> railscasthttp://railscasts.com/episodes/197-nested-model-form-part-2
>
> but each time that new fields are added to my form the fields are
> added above my table.  Therefore, when the remove links are clicked,
> it can't find the section to delete.  What am I doing wrong?
>
> in the view:
>
> <tbody>
>
>         <% echantillon_form.fields_for :treatments do |builder| %>
>            <%=  render  "treatment_fields", :f => builder %>
>         <% end %>
>
>       <%= link_to_add_fields "Add treatment",
> echantillon_form, :treatments %>
>
>   <%= echantillon_form.submit "Submit" %>
>   <% end %>
> </tbody>
> </table>
>
> in the partial:
>
> <div class = "fields">
>
> <%= f.label(:treatmenttype, "type de traitement", :class => "name") %>
> <%= f.text_field :treatmenttype %>
>
> <%= f.label(:treatmenttype, "commentaires sur la preparation", :class
> => "name") %>
> <%= f.text_field :preparation %>
>
> <%= f.hidden_field :_destroy %>
>
> <%= link_to_remove_fields "remove", f %>
>
> </div>

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