1
0
This repository has been archived on 2023-12-07. You can view files and clone it, but cannot push or open issues or pull requests.
body_tracking/app/views/goals/_show_form.html.erb
cryptogopher f9ba308072 Added test_create_binding_target
Goals (incl. binding) are required to have targets
Plugin fixtures are available through accessors
2020-08-20 21:52:18 +02:00

24 lines
959 B
Plaintext

<%= fields_for 'goal', goal do |ff| %>
<label for="goal_id"><%= l(:field_goal) %><span class="required"> *</span></label>
<%= ff.select :id,
options_from_collection_for_select(@project.goals, :id, :name, goal.id),
{required: true}, autocomplete: 'off',
onchange: "var goal_id = $('#target_goal_attributes_id').val();
$.ajax({
url: '#{goal_path(id: :goal_id)}'.replace('goal_id', goal_id),
dataType: 'script'
});
return false;" %>
<%= link_to l(:button_add), '#',
onclick: "var goal_id = $('#target_goal_attributes_id').val();
$.ajax({
url: '#{edit_goal_path(id: :goal_id)}'.replace('goal_id', goal_id),
dataType: 'script'
});
return false;",
class: 'icon icon-add' %>
<% end %>
<% if goal.description? %>
<p style='white-space: pre-wrap;' ><%= goal.description %></p>
<% end %>