tabletop-companion/app/views/counters/_form.html.erb

17 lines
548 B
Plaintext

<section class="inset">
<%= form_with model: @counter, url: character_sheet_section_counters_path(@section) do |f| %>
<% if @counter.new_record? %>
<%= f.fields_for :character_sheet_feature do |ff| %>
<%= ff.hidden_field :featurable_id, value: @counter.id %>
<%= ff.hidden_field :character_sheet_section_id, value: @section.id %>
<% end %>
<% end %>
<%= f.label :name %>
<%= f.text_field :name %>
<%= display_form_errors(@section, :name) %>
<%= f.submit button_text %>
<% end %>
</section>