summaryrefslogtreecommitdiff
path: root/app/views
diff options
context:
space:
mode:
authorerdgeist <erdgeist@erdgeist.org>2026-07-08 22:49:49 +0200
committererdgeist <erdgeist@erdgeist.org>2026-07-08 22:49:49 +0200
commit0bc112baec8b3d19aba3c1757cb4cf81fda098c5 (patch)
tree4c5738174e6e7ba033fe0d4aeef8928c1d3d24b4 /app/views
parente8746f51be856f9c65049b5fce3c504f1ce26470 (diff)
Fix blank-title validation and its lost form state on re-render
A blank title failed presence and length validation simultaneously, showing two redundant messages for one problem; length now skips whenever slug is already blank, matching presence's own skip condition. Separately, create's failure path never computed @selected_kind/@parent_id/@parent_name the way new does, so re-rendering after a validation error silently lost which kind and parent had been chosen -- for the auto-tagging/auto-templating kinds, that meant a corrected resubmission could silently produce a plain generic node instead. required on the title field closes the common case without a round trip; the server-side fix remains the actual guarantee, since required is trivially bypassed.
Diffstat (limited to 'app/views')
-rw-r--r--app/views/nodes/new.html.erb2
1 files changed, 1 insertions, 1 deletions
diff --git a/app/views/nodes/new.html.erb b/app/views/nodes/new.html.erb
index 71f2fbf..afc632f 100644
--- a/app/views/nodes/new.html.erb
+++ b/app/views/nodes/new.html.erb
@@ -25,7 +25,7 @@
25 25
26 <div class="node_description">Title</div> 26 <div class="node_description">Title</div>
27 <div class="node_content"> 27 <div class="node_content">
28 <%= text_field_tag :title %> 28 <%= text_field_tag :title, nil, required: true %>
29 <span class="field_hint">A URL slug will be generated from this automatically. You can review or adjust it afterward under the "metadata" section's Slug field.</span> 29 <span class="field_hint">A URL slug will be generated from this automatically. You can review or adjust it afterward under the "metadata" section's Slug field.</span>
30 </div> 30 </div>
31 31