Skip to main content
rule

rails-cursorrules-prompt-file — Cursor rule: Rails 8 conventions

A Cursor rule file that tells the agent how to write Rails 8 code: generators, bin/dev, the Solid stack, Minitest and Hotwire.

Install into Cursor · Manually: put the files in place All methods and platforms ↓
.cursor/rules/rails-cursorrules-prompt-file.mdc
Open on GitHub

What rails-cursorrules-prompt-file does

This is a Cursor rules file that steers the agent toward Rails 8 conventions in your project. The content is a short list of habits: reach for Rails command-line generators instead of hand-written boilerplate, run local development with bin/dev, and check logs after significant changes.

Rails 8 specifics get their own line — Solid Queue, Solid Cache, Solid Cable, Propshaft and Kamal where appropriate. Controllers should stay RESTful and focused, and complex business logic belongs in service objects. On the database side the rule asks for PostgreSQL, proper indexes, connection pooling and safe migrations.

Testing means Minitest coverage for models, controllers and integration flows. For interactivity the rule prefers Hotwire and brings in Vite only when npm-managed JavaScript is needed. One thing to know before you drop it in: the frontmatter sets alwaysApply: false, so the rule will not fire on its own. You have to enable it yourself, and that is easy to miss.

What it helps with

  • keep the agent on one coding style across a Rails 8 project
  • push Cursor toward generators instead of hand-written boilerplate
  • settle on RESTful controllers with service objects for complex logic
  • spell out PostgreSQL, indexes and safe migrations
  • standardise on Minitest and Hotwire for tests and interactivity

Example prompts for the agent

  • Add a new resource for articles: generate the model, controller and migration following the Rails 8 rules
  • Refactor this controller — it grew too big, move the logic into a service object
  • Set up local development with bin/dev and check the logs after the changes

How to install rails-cursorrules-prompt-file

Manually: put the files in place

.cursor/rules/rails-cursorrules-prompt-file.mdc

Frontmatter: description, globs, alwaysApply

Step by step, with commands for each platform: Cursor rules: .mdc files, four modes and what replaced .cursorrules

Questions about rails-cursorrules-prompt-file

How do I install rails-cursorrules-prompt-file in Cursor?

Create .cursor/rules/rails-cursorrules-prompt-file.mdc in your project root and paste the rule content into it.

What does rails-cursorrules-prompt-file do?

It gives the Cursor agent a set of Rails 8 conventions: generators, bin/dev, Solid Queue and Cache, Propshaft, Kamal, PostgreSQL, Minitest and Hotwire.

Does the rule apply automatically?

No. The frontmatter sets alwaysApply: false, so you need to enable the rule manually or Cursor will not pick it up.

Source text

rails-cursorrules-prompt-file.mdc · CC0-1.0
---
description: "Cursor rules for Rails development with basic setup."
globs: **/*
alwaysApply: false
---
Rails 8 Development Guidelines

- Prefer Rails command-line generators over hand-written boilerplate.
- Use `bin/dev` for local development and check logs after significant changes.
- Follow Rails 8 conventions for Solid Queue, Solid Cache, Solid Cable, Propshaft, and Kamal where appropriate.
- Keep controllers RESTful and focused; use service objects for complex business logic.
- Use PostgreSQL, proper indexes, connection pooling, and safe migrations.
- Write Minitest coverage for models, controllers, and integration flows.
- Use Hotwire for standard Rails interactivity and Vite only when npm-managed JavaScript is needed.

© PatrickJS · CC0-1.0 · PatrickJS/awesome-cursorrules

Similar IDE rules

All IDE rules for Backend and APIs →

From the same set68

react-typescript-nextjs-nodejs-cursorrules-prompt- A Cursor rule that pins down React, TypeScript, Next.js 14 and Node.js conventions: functional components, RORO, minimal use client. ★ 41,011repo stars react-styled-components-cursorrules-prompt-file A Cursor rule that tells the agent how to write React code with styled-components: functional components, theming through ThemeProvider, a fixed folder layout. ★ 41,011repo stars react-query-cursorrules-prompt-file A Cursor rule that tells the agent how to write React Query code: where QueryClient lives, how hooks and query keys are named. ★ 41,011repo stars react-native-expo-cursorrules-prompt-file A Cursor rule that tells the agent how to write React Native code with Expo. Useful when you want new screens and components to follow one stack. ★ 41,011repo stars qwik-basic-cursorrules-prompt-file A Cursor rule that sets Qwik conventions for the agent: lazy functions with the $ suffix, signals, tasks, and a TypeScript plus Vite project layout. ★ 41,011repo stars python A Cursor rule that sets project layout, code style and stack choices for Python work with Flask and SQLite. Useful when the agent edits files in your repo. ★ 41,011repo stars python-github-setup-cursorrules-prompt-file Tells Cursor how to write and review Python code: style, tests, GitHub Pull Requests and GitHub Actions CI. Useful when the team has no shared rulebook. ★ 41,011repo stars python-fastapi-best-practices-cursorrules-prompt-f A Cursor rule that sets the agent's coding style for Python and FastAPI: functional code, Pydantic v2, async operations. ★ 41,011repo stars

Project sponsors

Companies that keep this analytics open
Gold sponsor

Impressions, clicks and code copies — open statistics. We keep the numbers public for the same reason NeBlask itself is public. Become a sponsor