From b72c82fb2b2f1af3d738ac14547a75c4383507b5 Mon Sep 17 00:00:00 2001 From: Rick Barrette Date: Mon, 17 Aug 2026 21:03:37 -0400 Subject: [PATCH] Dynamically update the link with estimate id --- app/views/customers/_actions.html.erb | 58 ++++++++++++++++++++++++++- app/views/estimates/_list.html.erb | 4 +- 2 files changed, 59 insertions(+), 3 deletions(-) diff --git a/app/views/customers/_actions.html.erb b/app/views/customers/_actions.html.erb index ba7bec2..57f86a9 100644 --- a/app/views/customers/_actions.html.erb +++ b/app/views/customers/_actions.html.erb @@ -1,7 +1,7 @@ <%= call_hook :customer_actions_top, { customer: @customer } %>

- <%= link_to t(:label_new_issue), new_issue_path(issue: { customer_id: @customer.id }), target: :_blank %> + <%= link_to t(:label_new_issue), new_issue_path(issue: { customer_id: @customer.id }), id: "dynamic-new-issue-link", target: :_blank %>

@@ -15,3 +15,59 @@ <%= call_hook :customer_actions_bottom, { customer: @customer } %> <%= button_to t(:label_edit_customer), edit_customer_path(@customer), method: :get%> + + \ No newline at end of file diff --git a/app/views/estimates/_list.html.erb b/app/views/estimates/_list.html.erb index 9974e7a..db22fd8 100644 --- a/app/views/estimates/_list.html.erb +++ b/app/views/estimates/_list.html.erb @@ -2,11 +2,11 @@ <% estimates.sort.reverse.each do |estimate| %>

- <%= check_box_tag "estimate_ids[]", estimate.id, false, onchange: "updateLink()", data: { url: estimate_path(estimate), text: "Estimate ##{estimate.to_s}" }, class: "estimate-checkbox appointment" %> + <%= check_box_tag "estimate_ids[]", estimate.id, false, onchange: "updateLink()", data: { text: "Estimate ##{estimate.doc_number}" }, class: "estimate-checkbox appointment" %> <%= link_to "##{estimate.doc_number}", estimate_path(estimate), target: :_blank %> <%= estimate.txn_date %>
<% end %> <% else %>

<%=t(:label_no_estimates)%>.

-<% end %> +<% end %> \ No newline at end of file