<% builder.object.page_parts.each_with_index do |page_part, index| %>
- <%= link_to page_part.name, "#page_part_tab_#{index}" %>
<% end %>
<% builder.object.page_parts.each_with_index do |page_part, index| %>
- ">
<%= builder.fields_for :page_parts, page_part do |page_part_builder| %>
<%= render :partial => 'page_part_builder', :object => page_part_builder %>
<% end %>
<% end %>
<% new_page_part_tab_panel = capture do %>
<%= builder.fields_for :page_parts, PagePart.new, :child_index => 'new_page_part_tab_panel_index' do |page_part_builder| %>
<%= render :partial => 'page_part_builder', :object => page_part_builder %>
<% end %>
<% end %>
<%= javascript_tag do %>
var new_page_part_tab_panel = '<%= escape_javascript new_page_part_tab_panel.strip %>'
<% end %>