Targets form allows only targets within one Goal
This commit is contained in:
parent
cf0e14d87d
commit
7e8508f9d4
@ -1,20 +1,19 @@
|
||||
<%= error_messages_for *@targets %>
|
||||
|
||||
<% @targets.group_by(&:goal).each do |goal, targets| %>
|
||||
<div class="box">
|
||||
<div class="box">
|
||||
<div id='goal-form' class="tabular">
|
||||
<% if goal.persisted? || goal.is_binding? %>
|
||||
<p><%= render partial: 'goals/show_form', locals: {goal: goal} %></p>
|
||||
<p><%= f.date_field :effective_from, disabled: !goal.is_binding? %></p>
|
||||
<% if current_goal.persisted? %>
|
||||
<p><%= render partial: 'goals/show_form', locals: {goal: current_goal} %></p>
|
||||
<p><%= f.date_field :effective_from, disabled: !current_goal.is_binding? %></p>
|
||||
<% else %>
|
||||
<%= render partial: 'goals/form', locals: {goal: goal} %>
|
||||
<%= render partial: 'goals/form', locals: {goal: current_goal} %>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<hr style="width: 95%;">
|
||||
|
||||
<div class="tabular">
|
||||
<% targets.each do |target| %>
|
||||
<% @targets.each do |target| %>
|
||||
<p class="target">
|
||||
<%= f.fields_for 'targets', target, index: '' do |target_f| %>
|
||||
<%= target_f.hidden_field :id %>
|
||||
@ -46,8 +45,7 @@
|
||||
onclick: 'newTarget(); return false;' %>
|
||||
</p>
|
||||
</div>
|
||||
</div>
|
||||
<% end %>
|
||||
</div>
|
||||
|
||||
<%= javascript_tag do %>
|
||||
function showQuantityPath(event) {
|
||||
|
Reference in New Issue
Block a user