Class: StimulusGridRails::HistoryController
- Inherits:
-
BaseController
- Object
- BaseController
- StimulusGridRails::HistoryController
- Defined in:
- app/controllers/stimulus_grid_rails/history_controller.rb
Overview
Undo / redo — RAILS.md §16.
POST /grids/:resource/undo → revert the user's last mutation
POST /grids/:resource/redo → re-apply the last undone mutation
Each replays the prior/new value through grid.apply_cell!, so it goes through the same save → validation → cascade → auto-broadcast path as a normal edit. Scoped per current_user + resource. Audits whose row has since been deleted are skipped (and marked) rather than failing the request.
Constant Summary collapse
- SCAN_LIMIT =
50
Instance Method Summary collapse
-
#redo_change ⇒ Object
‘redo` is a Ruby keyword, so the action is named redo_change.
- #undo ⇒ Object