rails-expert

Optimize Rails 7+ apps with ActiveRecord, Hotwire, Sidekiq, and RSpec.

Updated Oct 12, 2024
One-click install
npx skills add https://github.com/samrocks03/shuttle-office-service --skill rails-expert-samrocks03
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: rails-expert
Source: https://github.com/samrocks03/shuttle-office-service/tree/main/.agents/skills/rails-expert
Command: npx skills add https://github.com/samrocks03/shuttle-office-service --skill rails-expert-samrocks03

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Optimizes Rails 7+ applications by reducing database load, enabling real-time features, and streamlining background processing.

Core Features & Use Cases

  • ActiveRecord optimization: Uses includes and eager_load to prevent N+1 queries across complex associations.
  • Hotwire integration: Implements Turbo Frames and Turbo Streams for partial page updates and smoother UX.
  • Background processing: Configures Sidekiq workers and ActiveJob integration for asynchronous tasks.
  • Real-time features: Sets up Action Cable for WebSocket communication to push updates to clients.
  • Testing discipline: Provides comprehensive RSpec test suites to ensure reliability across models, controllers, and jobs. Use Case: Build a Rails 7+ application with responsive UIs, real-time dashboards, and robust test coverage.

Quick Start

Set up a Rails 7+ project configured with ActiveRecord optimization, Hotwire (Turbo Frames/Streams), Action Cable, Sidekiq workers, and a robust RSpec suite.

Frequently Asked Questions about rails-expert

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I fix N+1 queries in Rails ActiveRecord associations?

Fix N+1 queries in Rails by using `includes` and `eager_load` to preload complex ActiveRecord associations, reducing database load and preventing repetitive query execution during data retrieval.

How do I implement partial page updates with Hotwire Turbo Frames in Rails?

Implement partial page updates in Rails 7+ by configuring Hotwire Turbo Frames and Turbo Streams to refresh specific DOM elements without full page reloads, creating smoother user experiences.

What is the best way to set up background processing in Rails with Sidekiq?

Set up Rails background processing by configuring Sidekiq workers and ActiveJob integration to handle asynchronous tasks, streamlining heavy operations outside the main web request cycle.

Can I use Action Cable for real-time WebSocket updates in a Rails 7 application?

Action Cable in Rails 7+ supports real-time WebSocket communication to push live updates directly to clients, enabling features like real-time dashboards and interactive UIs.

How do I test Sidekiq jobs and Action Cable channels using RSpec?

Test Sidekiq jobs and Action Cable channels in Rails by writing comprehensive RSpec test suites that validate behavior across models, controllers, and background workers to ensure reliability.