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.
 
 
 
 
 

11 lines
541 B

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