rails-action-text

Installation
SKILL.md

Rails Action Text

Rich Text Usage

  • Use has_rich_text :field for storing long-form or formatted content
  • Avoid storing raw HTML in plain string columns
  • Use .to_plain_text or .to_trix_html when rendering or indexing rich content
  • Validate presence on the virtual attribute: validates :body, presence: true

Embeds vs Attachments

  • Attachments are files/media associated with the model
  • Embeds are inline references within the rich text content
  • Use record.body.attachables to retrieve embedded models
  • Use ActionText::Attachable.from_attachable(record) to generate embeds
  • Don't manually serialize attachable_sgid unless you fully control the context

Security & Sanitization

Installs
2
First Seen
May 8, 2026
rails-action-text — gierd-inc/dev-skills