Skip to content

Instantly share code, notes, and snippets.

@ezr-ondrej
Last active November 19, 2019 20:59
Show Gist options
  • Save ezr-ondrej/37f13208ad36126cb4720084a4576aa7 to your computer and use it in GitHub Desktop.
Save ezr-ondrej/37f13208ad36126cb4720084a4576aa7 to your computer and use it in GitHub Desktop.
<tr>
<td>
<%= f.text_field(:name, ... %>
</td>
<td>
<%= f.text_field(:value, ... %>
</td>
<td>
<%= link_to_remove_fields(_('Remove'), f) if f.object.new_record? %>
</td>
</tr>
<div id="ec2_tags">
<table>
<!-- with cols name, value, action -->
<% tags.each do |key, val| %>
<%= f.fields_for :tags, OpenStruct.new(name: key, value: val) do |fields| %>
<%= render "compute_resources/ec2_tag", :f => builder %>
<% end %>
<% end %>
<%= link_to_add_fields('+ ' + _("Add tag"), f, :tags, "compute_resources/ec2_tag", { :target => '#ec2_tags' }) %>
</table>
</div>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment