<% if !f.object.nil? && !f.object.property_links.blank? %>
<% f.object.property_links.each_with_index do |property_link, i| %> <%= f.fields_for :property_links, property_link do |f| %> <%= render :partial => 'form_link', :object=> property_link, :locals => {:f => f, :i => i } %> <% end %> <% end %>
<% end %>

<%= hidden_field_tag 'property_link_field_count', f.object.property_links.count %> <%= t(:add) %>

<% if !f.object.nil? && !f.object.property_files.blank? %>
<% f.object.property_files.each_with_index do |property_file, i| %> <%= f.fields_for :property_files, property_file do |f| %> <%= render :partial => 'form_file',:object => property_file, :locals => {:f => f, :i => i} %> <% end %> <% end %>
<% end %>

<%= hidden_field_tag 'property_file_field_count', f.object.property_files.count %> <%= t(:add) %>