# Auto Save Action Text Data in Rails

Automatically save rich text in local storage using Stimulus.

![MacBook Air on gray armchair](https://cdn.hashnode.com/res/hashnode/image/upload/v1769077456443/8feb9a1c-6a94-4717-815f-71d1d2eea393.jpeg)

Photo by [Goran Ivos](https://unsplash.com/@goran_ivos?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/s/photos/writer-with-computer?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)

1.  Create a Stimulus controller.

%[https://gist.github.com/f30572016568be2af01ed5f07f81d7fe]

2\. Add controller to the `index.js` file.

%[https://gist.github.com/cf96ee6220a69535d307aff0a4873e15]

3\. Add controller to the form in your view file.

%[https://gist.github.com/c9b4ebc32a6c3bbf10597f0ad6b9f533]
