You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

14 lines
662 B

<turbo-stream action="append" targets="#attachments">
<template>
<% @attachments.each_with_index do |attachment, i| %>
<%= fields_for "#{@attachable_for.class.name.underscore.singularize}[attachments_attributes][#{ Time.now.to_i + i }]", attachment do |builder| %>
<%= render partial: 'admin/attachments/attachment', locals: {f: builder}, formats: :html %>
<% end %>
<% end %>
<%# fields model: @node do |form| %>
<%# form.fields_for :attachments, @attachments do |builder| %>
<%# render partial: 'admin/attachments/attachment', locals: {f: builder} %>
<%# end%>
<%# end %>
</template>
</turbo-stream>