Despite its age, the very maintained open-source rich text editor TinyMCE works very well with Rails 7. Here’s a quick summary of what you need to know, including image uploading.
This article is not rocket science but comes about mostly because of the frustration I had in finding all the instructions in one place.
1. Install TinyMCE into your Rails app
//Gemfile
gem 'tinymce-rails'
As of this writing in May 2023 that gets me the version 6.4.1
2. Edit the tinymce.yml to your liking
Switches and options are always changing. Right now mine looks like this, but refer to the Documentation for what you can and can’t do
menubar: "insert view format table tools"
toolbar:
- bold italic | link | undo redo | forecolor backcolor | bullist numlist outdent indent | table | uploadimage | code
plugins:
- table
- fullscreen
- image
- code
- searchreplace
- wordcount
- visualblocks
- visualchars
- link
- charmap
- directionality
- nonbreaking
- media
- advlist
- autolink
- lists
images_upload_url: '/uploader/image'
NOTE: for image uploading to work you need that last line!