
Security News
CISA’s 2025 SBOM Guidance Adds Hashes, Licenses, Tool Metadata, and Context
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Filepress is a minimal Rails plugin that offers the best of both worlds for content management:
Ideal for blogs, documentation, or any content-driven Rails app where you want the flexibility of flat files and the structure of a database.
Add it to your Gemfile:
gem "filepress"
Then run:
bundle install
Be sure to include a field that can serve as a unique identifier (e.g. slug
):
rails g model Post title:string slug:string body:text
Use the filepress
method in your model class:
class Post < ApplicationRecord
filepress
end
Create Markdown files in app/content/posts
. Each file should include frontmatter:
---
title: My First Post
slug: first
---
# Hello, this is my first post
Run the sync task to import your files into the database:
bin/rails filepress:sync
That’s it! You’re now free to query your content via ActiveRecord like any other model. Filepress doesn't dictate how you render the body—use a Markdown parser like Kramdown, Redcarpet, or similar.
Filepress reads your content files, extracts YAML frontmatter, and uses the values to populate or update model attributes. The rest of the file becomes the value of the body attribute (or another field, if configured).
You can customize how Filepress behaves by passing options to filepress
:
from:
- Set a custom content directoryclass Post
filepress from: "app/my_custom_content_folder"
end
glob:
- Use filetypes besides Markdownclass Post
filepress glob: "*.html"
end
key:
- Use a unique identifier other than slug
class Post
filepress key: :name
end
body:
- Set which attribute stores the main contentclass Post
filepress body: :content
end
destroy_stale:
- Prevent deletion of records when files are removedBy default, Filepress deletes records when the corresponding file is removed. Disable this behavior with:
class Post
filepress destroy_stale: false
end
Filepress is for you if:
FAQs
Unknown package
We found that filepress demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
CISA’s 2025 draft SBOM guidance adds new fields like hashes, licenses, and tool metadata to make software inventories more actionable.
Security News
A clarification on our recent research investigating 60 malicious Ruby gems.
Security News
ESLint now supports parallel linting with a new --concurrency flag, delivering major speed gains and closing a 10-year-old feature request.