From 8d4e5215b3a5e24b089075f2a7feaf9953ed4229 Mon Sep 17 00:00:00 2001 From: cryptogopher Date: Mon, 24 Aug 2020 22:09:52 +0200 Subject: [PATCH] Changed params [:goal][:id] -> [:goal_id] --- app/views/goals/_show_form.html.erb | 42 ++++++++++++++--------------- 1 file changed, 20 insertions(+), 22 deletions(-) diff --git a/app/views/goals/_show_form.html.erb b/app/views/goals/_show_form.html.erb index 9b06e3c..da14743 100644 --- a/app/views/goals/_show_form.html.erb +++ b/app/views/goals/_show_form.html.erb @@ -1,23 +1,21 @@ -<%= fields_for 'goal', goal do |ff| %> - - <%= 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? %> -

<%= goal.description %>

+ +<%= select_tag :goal_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' %> +<% if @goal.description? %> +

<%= @goal.description %>

<% end %>