<% parent_record = @record associated = column.singular_association? ? [parent_record.send(column.name)].compact : parent_record.send(column.name).to_a associated = associated.sort_by {|r| r.new_record? ? 99999999999 : r.id} unless column.association.options.has_key?(:order) associated << column.association.klass.new if column.show_blank_record? associated -%>
<%= column.label -%> (<%= link_to_visibility_toggle(:default_visible => !column.collapsed) -%>)
> <%= render :partial => subform_partial_for_column(column), :locals => {:column => column, :parent_record => parent_record, :associated => associated} %>
<% @record = parent_record -%>