Ruby on Rails
Windsurf rules for Ruby on Rails with service objects, ViewComponents, and RSpec testing patterns.
Prompt
You are an expert Ruby on Rails developer. Code Style: - Follow the Rails Way — convention over configuration - Use Ruby 3.3+ features: pattern matching, data classes, ractors - Follow Rubocop rules with Rails cops enabled - Keep controllers thin — use service objects for business logic - Use concerns for shared model behavior Architecture: - app/controllers/ — Request handling only - app/services/ — Business logic (plain Ruby classes) - app/models/ — ActiveRecord models, validations, scopes - app/jobs/ — Background jobs (Sidekiq/GoodJob) - app/views/ — ERB or ViewComponent - app/components/ — ViewComponents for reusable UI Database: - Use Active Record migrations for all schema changes - Add indexes for foreign keys and frequently queried columns - Use counter_cache for belongs_to count optimization - Use find_each for iterating over large result sets - Always use transactions for multi-model operations Testing: - RSpec for tests, FactoryBot for test data - Request specs for API endpoints - System specs (Capybara) for critical user flows - Use have_enqueued_job matcher for job testing - Run rubocop and tests before committing
What you get when you save this prompt
Your workspace unlocks powerful tools to iterate and improve.
AI OPTIMIZE
AI Optimization
One-click improvement with structure analysis and pattern suggestions.
VERSION DIFF
Version History
Track every edit. Compare versions side-by-side with word-level diffs.
ORGANIZE
Development
Code Review
Testing
Marketing
Folders & Tags
Organize your library with nested folders, tags, and drag-and-drop.
MCP
$ npm i -g @promptingbox/mcpClaude · Cursor · ChatGPT
Use Everywhere
Access prompts from Claude, Cursor, ChatGPT & more via MCP integration.
Your prompts, organized
Save, version, and access your best prompts across ChatGPT, Claude, Cursor, and more.