summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-07-17 18:02:29 +0200
committererdgeist <erdgeist@erdgeist.org>2026-07-17 18:02:29 +0200
commit93831ac04e4e44f60397572dd0172c456781de30 (patch)
treeb4658bbeb9f3977b85118b163273352812b5227e
parentd753bc463bee67b562fa8cc260db88916d51d70d (diff)
Fix computed_unique_name code and consumer
-rw-r--r--app/models/node.rb2
-rw-r--r--app/views/nodes/new.html.erb2
2 files changed, 2 insertions, 2 deletions
diff --git a/app/models/node.rb b/app/models/node.rb
index 717f5b4..4f585e1 100644
--- a/app/models/node.rb
+++ b/app/models/node.rb
@@ -269,7 +269,7 @@ class Node < ApplicationRecord
269 end 269 end
270 270
271 def computed_unique_name 271 def computed_unique_name
272 path = path_to_root[1..-1].join("/") # excluding root 272 path_to_root[1..-1].join("/") # excluding root
273 end 273 end
274 274
275 def current_unique_name 275 def current_unique_name
diff --git a/app/views/nodes/new.html.erb b/app/views/nodes/new.html.erb
index 38eac84..890d46e 100644
--- a/app/views/nodes/new.html.erb
+++ b/app/views/nodes/new.html.erb
@@ -33,7 +33,7 @@
33 <div class="node_description">Parent</div> 33 <div class="node_description">Parent</div>
34 <div class="node_content"> 34 <div class="node_content">
35 <%= text_field_tag :parent_search_term, @parent&.title %> 35 <%= text_field_tag :parent_search_term, @parent&.title %>
36 <%= hidden_field_tag :parent_id, @parent&.id, data: { unique_name: @parent&.current_unique_name } %> 36 <%= hidden_field_tag :parent_id, @parent&.id, data: { unique_name: @parent&.computed_unique_name } %>
37 <div id="parent_search_results" class="search_results"></div> 37 <div id="parent_search_results" class="search_results"></div>
38 </div> 38 </div>
39 </div> 39 </div>