diff options
| author | erdgeist <erdgeist@erdgeist.org> | 2026-07-13 17:09:31 +0200 |
|---|---|---|
| committer | erdgeist <erdgeist@erdgeist.org> | 2026-07-13 17:09:31 +0200 |
| commit | aa14587b052a0aa7884aaf27183981975168ab14 (patch) | |
| tree | 2b043061a06474929bbfb9fe79a7985267ccef17 /config | |
| parent | 0b6ae26f3b4c3c8278e569fa6644a544e996c25d (diff) | |
Wire real autosave into translation editing
The shared TinyMCE setup initializes cccms.setup_autosave() on any
page with a textarea.with_editor, unconditionally starting a
7-second interval that submits to the form's data-autosave-url --
which the translation edit form never set, so the interval PUT the
current page URL itself and 404'd on a nonexistent route.
Fixed by actually giving it something to talk to, rather than
suppressing it: a real autosave endpoint, and update now goes
through Node#autosave!/#save_draft! -- the same pipeline the
primary editor uses, fixed earlier this session for exactly this
kind of cross-locale carryover. This was the autosave-buffer parity
already flagged as due after the proof of concept; the shared JS
just forced the timing.
Diffstat (limited to 'config')
| -rw-r--r-- | config/routes.rb | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/config/routes.rb b/config/routes.rb index 38a497d..826bb18 100644 --- a/config/routes.rb +++ b/config/routes.rb | |||
| @@ -58,8 +58,11 @@ Cccms::Application.routes.draw do | |||
| 58 | resources :translations, controller: 'page_translations', | 58 | resources :translations, controller: 'page_translations', |
| 59 | param: :translation_locale, | 59 | param: :translation_locale, |
| 60 | constraints: { translation_locale: /en/ }, | 60 | constraints: { translation_locale: /en/ }, |
| 61 | only: [:index, :show, :edit, :update, :destroy] | 61 | only: [:index, :show, :edit, :update, :destroy] do |
| 62 | 62 | member do | |
| 63 | put :autosave | ||
| 64 | end | ||
| 65 | end | ||
| 63 | 66 | ||
| 64 | resources :related_assets, only: [:create, :destroy, :update] do | 67 | resources :related_assets, only: [:create, :destroy, :update] do |
| 65 | collection do | 68 | collection do |
