id attribute partial problem in tab

I have used JavaScript Tabifier automatically create an html css tabs interface in my rails view. My problem is when I place a partial in the second tab I lose access to the global @model.id attribute for reference purposes with the draggable_element.

<% for pdf in @article.pdfs %>   <%= image_tag pdf.title,       :style => "vertical-align: middle",       :id => "#{@article.id}_#{pdf.id}",       :class => "attached_pdf" %>

  <%= draggable_element "#{@article.id}_#{pdf.id}", :revert => true %> <% end %>

If I use "#{@article.title}_#{pdf.id}" for the image_tag :id and draggable_element id it works without problem. If I place the render partial call in the first tab it works without problems..

Any ideas?

The problem was the :id was not unique and clashed with other draggable attachments on different tabs.

By adding a unique string to the beginning of the id solved the problem:

:id => "pdflibrary_#{@article.id}_#{pdf.id}"