Fix targets#create
This commit is contained in:
@@ -15,7 +15,7 @@
|
||||
<h3><%= t ".heading_common" %></h3>
|
||||
<ul>
|
||||
<li>
|
||||
<%= link_to t(".link_targets"), project_targets_path(@project) %>
|
||||
<%= link_to t(".link_targets"), goal_targets_path(@project.goals.binding) %>
|
||||
/
|
||||
<%= link_to t(".link_goals"), project_goals_path(@project) %>
|
||||
</li>
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
<% if User.current.allowed_to?(:manage_body_trackers, @project) %>
|
||||
<%= link_to t(".link_new_target"),
|
||||
new_project_target_path(@project, @view_params),
|
||||
<%= link_to t(".link_new_target"), new_goal_target_path(@goal, @view_params),
|
||||
{remote: true, class: 'icon icon-add'} %>
|
||||
<% end %>
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
<h2><%= t ".heading_new_target" %></h2>
|
||||
|
||||
<%# url: project_targets_path(@project, @view_params), %>
|
||||
<%= labelled_form_for @goal, remote: true,
|
||||
<%= 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 %>
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
{include_blank: parent_id.nil? ? false : '.', required: true, no_label: true},
|
||||
{autocomplete: 'off',
|
||||
onchange: "$.ajax({
|
||||
url: '#{subthresholds_goal_targets_path(@goal, parent_id: parent_id)}',
|
||||
url: '#{project_subthresholds_path(@project, parent_id: parent_id)}',
|
||||
data: 'quantity_id=' + $(this).val(),
|
||||
dataType: 'html',
|
||||
success: function(data) {
|
||||
|
||||
Reference in New Issue
Block a user