diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-10 02:13:02 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-10 02:13:02 +0200 |
| commit | c2b2648d327e1c1749c37fe2e58cd051ed871547 (patch) | |
| tree | e8d3c48eb01b8d6b512d20603a1db8f910ec110c /app/controllers/nodes_controller.rb | |
| parent | 205e6216fc7850fe717122c189e5003d1f9e8afe (diff) | |
Destroying Draft or Discarding Autosave drops you where you left
Diffstat (limited to 'app/controllers/nodes_controller.rb')
| -rw-r--r-- | app/controllers/nodes_controller.rb | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/app/controllers/nodes_controller.rb b/app/controllers/nodes_controller.rb index d1538e1..6fcd930 100644 --- a/app/controllers/nodes_controller.rb +++ b/app/controllers/nodes_controller.rb | |||
| @@ -128,7 +128,10 @@ class NodesController < ApplicationController | |||
| 128 | def revert | 128 | def revert |
| 129 | @node.lock_for_editing!(current_user) | 129 | @node.lock_for_editing!(current_user) |
| 130 | @node.revert!(current_user) | 130 | @node.revert!(current_user) |
| 131 | if @node.draft | 131 | |
| 132 | if params[:return_to].present? | ||
| 133 | redirect_to safe_return_to(params[:return_to]) | ||
| 134 | elsif @node.draft | ||
| 132 | redirect_to edit_node_path(@node) | 135 | redirect_to edit_node_path(@node) |
| 133 | else | 136 | else |
| 134 | redirect_to node_path(@node) | 137 | redirect_to node_path(@node) |
