diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-08 16:24:05 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-08 16:24:05 +0200 |
| commit | 43e7743ebff1b1f41bbb5ae39bcc5bed7d8982e3 (patch) | |
| tree | d27f73cd3725b57cba22cac0692a178c500fd4f2 /app/views/nodes/edit.html.erb | |
| parent | c6bf63a82007c275d13e9e9e0857434b3b7890c0 (diff) | |
Autosave posts to its own endpoint surface lock loss immediately
Previously piggybacked on the main form's action and relied on a
.js.erb response to update #flash; now posts to the dedicated
autosave route with an explicit _method=put override, and reacts to
a 423 by stopping the timer and showing a persistent banner rather
than letting the next Save discover the conflict on its own.
Diffstat (limited to 'app/views/nodes/edit.html.erb')
| -rw-r--r-- | app/views/nodes/edit.html.erb | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/app/views/nodes/edit.html.erb b/app/views/nodes/edit.html.erb index 4693569..1c6cc3a 100644 --- a/app/views/nodes/edit.html.erb +++ b/app/views/nodes/edit.html.erb | |||
| @@ -5,7 +5,7 @@ | |||
| 5 | <% end %> | 5 | <% end %> |
| 6 | 6 | ||
| 7 | <div id="page_editor"> | 7 | <div id="page_editor"> |
| 8 | <%= form_for(@node) do |f| %> | 8 | <%= form_for(@node, html: { data: { autosave_url: autosave_node_path(@node), show_url: node_path(@node) } }) do |f| %> |
| 9 | <% if @node.errors.any? %> | 9 | <% if @node.errors.any? %> |
| 10 | <div class="error_messages"> | 10 | <div class="error_messages"> |
| 11 | <ul><% @node.errors.full_messages.each do |msg| %><li><%= msg %></li><% end %></ul> | 11 | <ul><% @node.errors.full_messages.each do |msg| %><li><%= msg %></li><% end %></ul> |
