RailsPress
A simple blog engine for Rails 8 applications.
Features
- Blog posts with rich text editing (Lexxy editor)
- Markdown Mode - Toggle between rich text and markdown editing
- Categories and tags
- SEO metadata (meta title, meta description)
- Draft/published workflow with automatic publish timestamps
- Admin interface for content management
- Focal Points - Set image focal points for smart cropping across different aspect ratios (docs)
- Entity System - Manage any ActiveRecord model through the admin (docs)
- Import/Export - Bulk markdown operations with YAML frontmatter (docs)
- Theming - CSS variable customization (docs)
Requirements
- Rails 8.0+
- Ruby 3.3+
- ActionText (for rich text)
- Active Storage (for image uploads)
Installation
Prerequisites
Ensure ActionText and Active Storage are installed in your application:
rails action_text:install
rails active_storage:install
rails db:migrateInstall RailsPress
Add to your Gemfile:
gem "railspress"Run the install generator (recommended):
bundle install
rails generate railspress:install
rails db:migrateOr manually copy migrations:
bundle install
rails railspress:install:migrations
rails db:migrateMount the engine in your routes:
# config/routes.rb
Rails.application.routes.draw do
mount Railspress::Engine => "/blog", as: :railspress
endAuthentication
Important: The admin interface is publicly accessible by default. You must configure authentication before deploying to production.
Add authentication to your application controller:
# app/controllers/application_controller.rb
class ApplicationController < ActionController::Base
before_action :authenticate_user!, if: :railspress_admin?
private
def railspress_admin?
request.path.start_with?("/blog/admin")
end
endSee CONFIGURING.md for more authentication patterns.
Usage
Access the admin interface at /blog/admin.
From there you can:
- Create and manage blog posts with rich text content
- Organize posts with categories
- Tag posts (enter tags as comma-separated values)
- Save posts as drafts or publish them
Generators
# Full installation (migrations, importmap, routes)
rails generate railspress:install
# Add a custom entity (managed through admin)
rails generate railspress:entity Project title:string description:text content:rich_textDocumentation
- Getting Started - Quick reference and models
- Entity System - Manage custom models through admin
- Building a Blog - Frontend controllers and views
- Configuration - Authors, images, and options
- Import/Export - Bulk operations
- Theming - CSS customization
- Troubleshooting - Common errors
- Changelog - Version history and release notes
Development
After checking out the repo:
bundle install
cd spec/dummy && bundle exec rails db:migrate && cd ../..
bundle exec rspecLicense
The gem is available as open source under the terms of the O'Saasy License.
Trademarks
The Rails trademarks are the intellectual property of David Heinemeier Hansson, and exclusively licensed to the Rails Foundation. Uses of "Rails" and "Ruby on Rails" in this project are for identification purposes only and do not imply an endorsement by or affiliation with Rails, the trademark owner, or the Rails Foundation.