From aa14587b052a0aa7884aaf27183981975168ab14 Mon Sep 17 00:00:00 2001 From: erdgeist Date: Mon, 13 Jul 2026 17:09:31 +0200 Subject: 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. --- config/routes.rb | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) (limited to 'config/routes.rb') diff --git a/config/routes.rb b/config/routes.rb index 38a497d0..826bb18c 100644 --- a/config/routes.rb +++ b/config/routes.rb @@ -58,8 +58,11 @@ Cccms::Application.routes.draw do resources :translations, controller: 'page_translations', param: :translation_locale, constraints: { translation_locale: /en/ }, - only: [:index, :show, :edit, :update, :destroy] - + only: [:index, :show, :edit, :update, :destroy] do + member do + put :autosave + end + end resources :related_assets, only: [:create, :destroy, :update] do collection do -- cgit v1.3