1
0

Proper nested records uniqueness validation

Test pass: test_create_duplicate_for_persisted_target_should_fail
This commit is contained in:
cryptogopher
2021-04-19 00:38:28 +02:00
parent dad116c573
commit 0b9401b089
10 changed files with 168 additions and 22 deletions

View File

@@ -5,6 +5,8 @@
<% end %>
<%= goal_f.fields_for :targets, @targets, child_index: '' do |target_f| %>
<%= error_messages_for target_f.object %>
<p class="target">
<%= target_f.hidden_field :_destroy %>
<em class="info"><%= t ".choose_quantity" %></em>

View File

@@ -4,7 +4,6 @@
<%= labelled_form_for @goal, url: goal_targets_path(@goal), method: :post, remote: true,
html: {id: 'new-target-form', name: 'new-target-form'} do |goal_f| %>
<%= error_messages_for *@targets %>
<div class="box tabular">
<%= render partial: 'targets/form', locals: {goal_f: goal_f} %>
</div>