100 Ruby on Rails resources for developers
The Ruby on Rails ecosystem has evolved into 'The One Person Framework' with the release of Rails 8, prioritizing self-hosting via Kamal and removing heavy dependencies like Redis for job processing. This resource guide focuses on the practical implementation of Rails 8 defaults, Hotwire patterns for modern frontends, and the integration of LLMs into Active Job pipelines.
Modern Frontend Development with Hotwire
- 1
Turbo Frames for Partial Page Updates
beginnerhighIsolate page segments to update content without a full reload. Use the 'src' attribute for lazy-loading heavy components like dashboards.
- 2
Turbo Streams over WebSockets
intermediatehighBroadcast model changes to all connected users using ActionCable. Use 'broadcast_replace_to' in models to trigger UI updates automatically.
- 3
StimulusJS State Management
beginnerstandardUse Stimulus Values and Classes APIs to manage toggle states and CSS transitions without writing custom event listeners.
- 4
ViewComponent for UI Encapsulation
intermediatemediumMove complex logic out of partials and into Ruby classes. Use GitHub's ViewComponent library for unit-testable UI units.
- 5
Turbo Morphing
intermediatehighEnable 'data-turbo-action="morph"' for smoother page transitions that preserve scroll position and input focus during updates.
- 6
Tailwind CSS JIT Integration
beginnerstandardConfigure tailwind.config.js to scan .rb and .erb files. Use the 'tailwindcss-rails' gem to manage the standalone CLI.
- 7
Phlex for Ruby-Based Views
advancedmediumAn alternative to ERB that uses pure Ruby objects for views, offering significant performance gains for high-traffic pages.
- 8
Stimulus Use Hooks
intermediatestandardImplement 'stimulus-use' for common patterns like click-outside, intersection observers, and debouncing in controllers.
- 9
Custom Turbo Stream Actions
advancedmediumExtend Turbo to handle non-standard DOM operations like triggering client-side logging or updating browser history.
- 10
Importmap-rails Management
beginnerstandardManage JavaScript dependencies without Node.js. Use 'bin/importmap pin' to add libraries directly from CDNs like JSPM.
Rails 8 Infrastructure and Deployment
- 1
Kamal Deployment Configuration
intermediatehighDeploy Rails applications to any VPS using Docker. Configure 'config/deploy.yml' with server IPs and environment secrets.
- 2
Solid Queue for Background Jobs
beginnerhighThe new Rails 8 default job runner. Move away from Redis and use your PostgreSQL or MySQL database for persistence.
- 3
Solid Cache for Database Caching
beginnermediumStore cache fragments in the database instead of RAM. Ideal for keeping larger amounts of data cached at a lower cost.
- 4
Thruster HTTP/2 Proxy
intermediatestandardUse the Thruster sidecar with Kamal to provide HTTP/2 support and asset compression without a complex Nginx setup.
- 5
Mission Control Jobs
beginnermediumInstall the 'mission_control-jobs' engine to get a built-in dashboard for monitoring and retrying Solid Queue jobs.
- 6
Prop: Rate Limiting
intermediatestandardImplement the 'prop' gem to prevent brute force attacks and API abuse by defining throttle strategies in an initializer.
- 7
Healthcheck Endpoint Configuration
beginnerstandardConfigure 'up' endpoints for Kamal or Kubernetes to monitor DB, Redis, and Job runner availability via 'rails-healthcheck'.
- 8
Zero-Downtime DB Migrations
advancedhighUse the 'strong_migrations' gem to detect and block unsafe operations like adding columns with defaults on large tables.
- 9
Kamal Accessory Management
intermediatemediumDefine databases and search engines as 'accessories' in deploy.yml to manage their lifecycle alongside the Rails app.
- 10
Multi-Environment Kamal Deploys
intermediatestandardUtilize Kamal's destination feature to manage staging and production environments within a single configuration file.
AI Integration and Data Patterns
- 1
Langchainrb Orchestration
intermediatehighUse the 'langchainrb' gem to build RAG (Retrieval Augmented Generation) pipelines within Rails service objects.
- 2
Pgvector for Semantic Search
advancedhighInstall the 'pgvector' extension on PostgreSQL and use the 'neighbor' gem to perform vector similarity searches on records.
- 3
Streaming LLM Responses
advancedhighUse ActionController::Live to stream OpenAI or Anthropic responses to the frontend as they are generated.
- 4
Active Job for LLM Callbacks
intermediatestandardOffload LLM API calls to background jobs to avoid blocking the web thread. Use Solid Queue for reliable retries on rate limits.
- 5
Structured Data with JSON Schema
intermediatemediumEnforce LLM output formats by passing JSON schemas to the OpenAI API and parsing responses into Active Model objects.
- 6
Embedding Generation on Save
intermediatemediumUse ActiveRecord callbacks to automatically update vector embeddings in a background job whenever a record is updated.
- 7
Token Usage Tracking
beginnerstandardImplement a 'Usage' model to track tokens consumed per user or per request to manage LLM costs and billing.
- 8
Prompt Versioning
beginnermediumStore system prompts in YAML files or a dedicated database table to version and A/B test prompt performance.
- 9
Function Calling with Rails Tools
advancedhighExpose Rails service objects as tools for LLMs, allowing models to query your database or trigger actions via API.
- 10
Local LLM Development with Ollama
beginnerstandardConnect your Rails development environment to Ollama to test AI features locally without incurring API costs.