actiontext-richtext
Installation
SKILL.md
ActionText (Rich Text)
Add rich text editing to Rails models. Trix editor + ActionText + ActiveStorage handle the editor, storage, and embedded attachments. Default Rails 8 has decent defaults — the gotchas are around sanitization, search indexing, and custom embeds.
The opinion
has_rich_text :bodyon the model. Trix is the default editor — fine for most cases. Sanitize on output (Rails does by default). Index the plain-text representation, not the HTML. For custom embeds (mentions, polls), use ActionText's attachable mixin. Don't migrate to TinyMCE/CKEditor unless you have a specific need — Trix's smaller surface area is a security win.
Counter-positions:
- TinyMCE / CKEditor / Tiptap — more powerful editors. Larger XSS attack surface, separate licensing. Pick only if Trix is genuinely insufficient.
Setup
bin/rails action_text:install
bin/rails db:migrate
Creates action_text_rich_texts and active_storage_blobs/attachments tables.