The Best Ways to Build a Blog in Rails 8: From Markdown to Action Text

Published: (February 4, 2026 at 07:08 PM EST)
3 min read
Source: Dev.to

Source: Dev.to

Cover image for The Best Ways to Build a Blog in Rails 8: From Markdown to Action Text

Introduction

The Developer’s Paradox
As developers, we want total control over our blog and to showcase our stack. Yet, building a custom admin panel often stalls content creation. Choose an architecture that aligns with how you write.

1. The “Indie Hacker” Way: Markdown + Git

How it works

Store posts as .md files in app/contents/posts/. Each file includes YAML front‑matter for metadata.

The Tech Stack

Why it’s great

  • Version Control – posts live in Git; git revert undoes mistakes.
  • Speed – no database queries; cache parsed HTML in memory or with Solid Cache.
  • Portability – content remains standard Markdown files if you leave Rails.

2. The “Omakase” Way: Action Text + Trix

How it works

Use Rails’ built‑in rich‑text attribute.

# app/models/post.rb
class Post < ApplicationRecord
  has_rich_text :content
end

Why it’s great

  • Image Handling – Active Storage manages uploads, resizing, and embedding.
  • Editor – Trix provides a clean, drag‑and‑drop experience.
  • Integration – Works seamlessly with the Rails ecosystem (e.g., ActionBroadcasting).

The Catch: Content is stored as HTML fragments in the database, making global find‑and‑replace or migrations slightly more cumbersome than Markdown.

3. The “Pro” Way: Rails + a Headless CMS

The Tech Stack

  • External CMS – Contentful, Strapi, or Spina CMS (a Rails‑native engine).
  • Logic – Rails fetches content via the CMS API and renders it.

Why it’s great

  • Separation of Concerns – No need to build image uploaders, previews, or draft/publish workflows; the CMS handles them.
  • SEO Tools – Built‑in SEO fields and validations.

The “Must‑Have” Checklist for any Rails Blog

1. RSS Feed

Provide a /feed.rss route (e.g., using jbuilder). RSS remains valuable for syndication.

2. Meta Tags (the meta-tags gem)

Add OpenGraph and Twitter Card tags so posts look good on social platforms. The gem lets you set titles, descriptions, and social images dynamically.

3. Proper Caching

Blogs are read‑heavy.

  • Use Fragment Caching for the post body.
  • Leverage Solid Cache (Rails 8) to keep caches persistent across deployments.

Summary: Which one should you choose?

  • Markdown – Ideal for solo developers who love Git and want to avoid a database.
  • Action Text – Best for a fully “Railsy” experience with in‑browser editing.
  • Spina or another Headless CMS – Perfect when you need a polished admin UI without building it yourself.

The best blog is the one you actually write in. Pick the approach that gets out of your way.

Are you building a custom blog or using a generator? Share your URLs in the comments! 👇

Back to Blog

Related posts

Read more »