Installation
Get RailsPress running in your Rails 8 application in under 5 minutes.
Requirements
- Ruby 3.3+
- Rails 8.1+
- PostgreSQL, MySQL, or SQLite
- ActionText (comes with Rails)
Quick Start
1. Add to Gemfile
Gemfile
gem "railspress-engine"
2. Install and Migrate
Terminal
$ bundle install
$ rails generate railspress:install
$ rails db:migrate
Mount the Engine
Add to your config/routes.rb:
config/routes.rb
Rails.application.routes.draw do
mount Railspress::Engine => "/railspress", as: :railspress
end
The admin interface will be available at /railspress/admin.
Admin Paths
| Path | Description |
|---|---|
/railspress/admin |
Dashboard |
/railspress/admin/posts |
Manage posts |
/railspress/admin/categories |
Manage categories |
/railspress/admin/tags |
Manage tags |
Models Reference
Railspress::Post
| Attribute | Type | Description |
|---|---|---|
title |
string | Post title (required) |
slug |
string | URL-friendly identifier (auto-generated) |
content |
rich_text | Post body (ActionText) |
status |
enum | draft or published |
published_at |
datetime | When post was published |
meta_title |
string | SEO title override |
meta_description |
text | SEO description |
category_id |
integer | Optional category |
excerpt |
text | Short summary used in blog listings |
reading_time |
integer | Auto-calculated reading time in minutes |
author_id |
integer | References the configured author model |
header_image |
attachment | Featured image for the post |
Associations:
belongs_to :category(optional)has_many :tags(through taggings)has_rich_text :content
Scopes:
published- Posts with status "published" and apublished_atdate setdrafts- Posts with status "draft"ordered- By created_at descendingrecent- Last 10 posts (ordered)scheduled- Posts with future published_at datelive- Alias for publishedby_author(author)- Filter posts by authorsearch(query)- Search posts by titleby_category(category_id)- Filter by categoryby_status(status)- Filter by status stringsorted_by(column, direction)- Multi-column sorting
Railspress::Category
| Attribute | Type | Description |
|---|---|---|
name |
string | Category name (required, unique) |
slug |
string | URL-friendly identifier (auto-generated) |
Railspress::Tag
| Attribute | Type | Description |
|---|---|---|
name |
string | Tag name (required, unique, lowercase) |
slug |
string | URL-friendly identifier (auto-generated) |