actiontext-richtext

Configure Rails 8 Action Text with Trix, sanitization, and plain-text search indexing.

21|2|Updated May 24, 2026
One-click install
npx skills add https://github.com/sandeepmvl/rails-skills --skill actiontext-richtext
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: actiontext-richtext
Source: https://github.com/sandeepmvl/rails-skills/tree/main/skills/35-actiontext-richtext
Command: npx skills add https://github.com/sandeepmvl/rails-skills --skill actiontext-richtext

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

AI coding agents often generate non-conventional, insecure Rails rich text implementations: they may skip critical XSS sanitization, misuse Active Storage for embedded attachments, index unsearchable raw HTML instead of plain text, or recommend less secure alternative editors without proper justification. This Skill ensures agents follow Rails 8 Action Text best practices for secure, maintainable rich text functionality.

Core Features & Use Cases

  • Secure Trix Integration: Adds the default Rails Trix WYSIWYG editor to models via has_rich_text with out-of-the-box XSS protection.
  • Embedded Attachment Handling: Automatically wires drag-and-drop image and file uploads to Active Storage with proper variant processing.
  • Search-Ready Content: Provides patterns for indexing plain-text extracted from rich text, compatible with tools like pg_search.
  • Use Case: For a Rails blog application, use this Skill to add a rich text editor for post bodies that safely handles embedded images, prevents XSS attacks, and lets users search post content without parsing raw HTML.

Quick Start

Use the actiontext-richtext skill to add a secure, Trix-powered rich text editor to your Rails Post model with embedded image support and plain-text search indexing.

Frequently Asked Questions about actiontext-richtext

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I add a secure rich text editor to my Rails 8 application?

You can add secure rich text editing by integrating Action Text with the Trix WYSIWYG editor, which provides out-of-the-box XSS sanitization. This ensures your rich text content is safely processed without exposing your application to cross-site scripting vulnerabilities.

How do I make Action Text content searchable with pg_search?

To make Action Text content searchable with pg_search, you must index the extracted plain text rather than the raw HTML. This approach allows full-text search tools to query the rich text content efficiently without parsing embedded HTML tags.

Does Action Text support drag-and-drop image uploads via Active Storage?

Yes, Action Text supports drag-and-drop image and file uploads by automatically wiring them to Active Storage. This integration includes proper variant processing to handle embedded attachments securely within the Trix editor.

How do I configure custom attachable embeds like user mentions in Trix?

You can configure custom attachable embeds like user mentions within Action Text by extending the Trix editor. This allows your Rails application to handle specialized rich content beyond standard images and files securely.

Why does my AI generated Rails rich text implementation have XSS vulnerabilities?

AI generated Rails rich text implementations often have XSS vulnerabilities because they skip critical HTML sanitization or misuse Active Storage. Using a guided Action Text integration ensures proper safe-list sanitization is applied to all rich content.