<% title_column_or_id = title_column(f.object.class) || "id" %> <% resource_title = f.object.send(title_column_or_id) %> class="associated-resource" data-label-input="<%= resource_name %>_<%= association %>_attributes_<%= index %>_<%= title_column_or_id %>"> <% if positionable?(f.object) %> <%= image_tag "drag-handle.png", :class => "handle" %> <% end %>
<% if f.object.persisted? %> <%= resource_title %> <% else %> [ <%= t('fullstack.admin.new_record', :default => "new record") %> ] <% end %>
<% if f.object.errors.any? %> " data-content='<%= h("#{f.errors(:wrap => false)}") %>' ><%= icon :"warning-sign" %> <% end %> <% if subject.can_edit?(f.object) %> <%= button t('fullstack.admin.edit', :default => "Edit"), "##{resource_name}_#{association}_fields_#{index}", :data => {:toggle => :modal} %> <% end %> <% if subject.can_destroy?(f.object) %> <%= button( t('fullstack.admin.delete', :default => "Delete"), "javascript:void(0)", :type => :danger, :class => "btn-delete-associated-resource", :"data-toggle" => :button ) %> <% end %>