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
2020-07-02 18:59:55 +02:00

24 lines
964 B
Plaintext

<%= fields_for 'target[goal_attributes]', goal do |ff| %>
<label><%= 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 %>