% 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="menu_links_attributes_<%= index %>_<%= title_column_or_id %>">
<% if f.object.persisted? %>
<%= resource_title %>
<% else %>
[ <%= t('fullstack.admin.new_record', :default => "new record") %> ]
<% end %>
|
<%= f.resource_inputs %>
<%= f.hidden_field(:_destroy, :class => "destroy-associated-resource") %>
<% if f.object.errors.any? %>
<%= 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 %>
|