Proper nested records uniqueness validation
Test pass: test_create_duplicate_for_persisted_target_should_fail
This commit is contained in:
@@ -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>
|
||||
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user