Best AI Coding Tools for Rails in 2026: Which One Actually Gets Hotwire?
We tested Cursor, Claude Code, Copilot, Windsurf, and Aider on real Rails 8 projects — Hotwire, Turbo, Solid Queue, and system tests. Here's which AI coding tools actually write Rails you'd ship in 2026.
Rails should be the easiest framework on earth for an AI coding tool to crush. Twenty years of public code, the most opinionated conventions in mainstream web development, and a docs site so clean you could prompt straight from it. And yet in 2026 most AI coding tools still write Rails like it’s 2018: before_action callbacks instead of Current attributes, respond_to blocks where Turbo Streams should live, fat controllers that ignore service objects, and absolutely zero awareness that Rails 8 shipped Solid Queue, Solid Cache, and Kamal as defaults. The gap between tools that actually understand modern Rails and tools pattern-matching an old Stack Overflow answer is enormous — and Rails devs feel it on every prompt.
We spent a week running every major AI coding tool against the same three Rails 8 projects: a Hotwire-driven CRM with Turbo Streams everywhere, a Solid Queue background job pipeline processing webhooks, and a multi-tenant SaaS using the new built-in authentication generator. Same prompts, same repos, same Ruby 3.3. Here’s which tools actually write idiomatic Rails in 2026.
The 30-Second Verdict
If you write Rails for a living and you want one tool that gets Hotwire right on the first try, Claude Code is the answer in 2026. It’s the only tool that consistently wrote Turbo Stream responses without us having to remind it that the form was inside a turbo-frame. Cursor is a very close second and wins on raw speed. GitHub Copilot is fine for line completion but falls apart the second you ask it to wire a Stimulus controller to a Turbo Stream. Windsurf is the dark horse — its Cascade agent handled multi-file Rails refactors better than anything else we tested. Aider is still the best terminal option for Rails purists who live in vim and want surgical diffs.
How We Tested
We gave each tool the exact same three tasks across three real Rails 8 codebases:
- The Hotwire CRM: Add a
Dealmodel with a state machine, render a Turbo Stream when the stage changes, and update a Stimulus-powered Kanban board without a full page reload. - The Solid Queue pipeline: Build a webhook intake controller that enqueues a job, retries with exponential backoff, and writes structured logs that play nicely with Rails 8’s new internal logging.
- The multi-tenant SaaS: Wire up the new Rails 8 authentication generator, scope every query to a
Current.account, and write system tests with Capybara that actually pass on the first run.
Same prompts. Same repos. Same Ruby 3.3.6, Rails 8.0.1, PostgreSQL 16. Each tool got one shot per task — no hand-holding, no follow-up nudges.
Claude Code: The One That Gets Turbo
Claude Code is the only tool we tested that wrote a Turbo Stream response without us having to mention the word “Turbo.” We asked it to “update the deal card when the stage changes” and it produced a turbo_stream.replace response, a matching _deal.html.erb partial, and a Stimulus controller that dispatched a custom event when the drag ended. It even remembered to add data-turbo-permanent to the search box so it wouldn’t lose focus on the morph.
The Solid Queue task went the same way. Claude Code knew that Rails 8 ships Solid Queue as the default, didn’t try to add gem "sidekiq" to the Gemfile, and wrote a perform method with retry_on and discard_on clauses that matched the Rails 8 idiom exactly. The structured logging used Rails.logger.tagged instead of inventing a new logger from scratch.
Where Claude Code shines on Rails is the same place it shines everywhere: it reads your existing code first. Drop a CLAUDE.md at the root of your Rails app describing your conventions (“we use service objects in app/services, never fat controllers”) and it will follow them religiously. Combine it with subagents to spin off a “Rails reviewer” agent that catches N+1 queries before you commit, and it’s the closest thing to a senior Rails dev pair-programming with you.
The downside: Claude Code is the slowest of the bunch. If you’re doing tab-completion on a long ERB template, it’ll feel sluggish compared to Copilot.
Cursor: The Fast One
Cursor was a hair behind Claude Code on Rails idiomaticity but won on every speed test. Its Composer agent handled the Hotwire CRM task in about 40% less wall-clock time, and the multi-file edits across app/controllers, app/views, and app/javascript/controllers were clean enough to merge without changes.
The trick to making Cursor write good Rails is the .cursorrules file. Drop in something like:
- Use Rails 8 conventions: Solid Queue, Solid Cache, built-in auth generator
- Prefer Turbo Streams over respond_to blocks
- Service objects live in app/services and return Result objects
- All system tests use Capybara with the new Playwright driver
- Never use `before_action :authenticate_user!` — use `Current.user` instead
…and Cursor will follow it almost as religiously as Claude Code follows CLAUDE.md. Without a .cursorrules file, Cursor defaults to Rails 6 patterns about a third of the time, which is the single biggest gotcha for Rails devs trying it for the first time.
Cursor’s tab completion is the best in the business for ERB templates. It correctly closes <%= %> tags, knows when you’re inside a form_with block, and suggests the right field helper for the column type. Copilot is close but not quite there.
GitHub Copilot: Fine for Lines, Bad for Architecture
Copilot is still the best pure tab-completion tool for Ruby and ERB. If you’re typing out a model and you’ve already written validates :email,, Copilot will finish the line correctly nine times out of ten. If you’re inside a controller action and you start typing @deals = Deal., it’ll suggest the right scope based on the rest of your codebase.
Where Copilot falls apart on Rails is anything that requires understanding more than one file at a time. We asked it to “add a Turbo Stream response to the deals controller” and it wrote a respond_to block with a format.turbo_stream line — technically correct, but the partial it referenced didn’t exist and it never offered to create it. Cursor and Claude Code both wrote the partial automatically.
Copilot’s chat mode is better than it used to be but still feels like a step behind Cursor’s Composer for multi-file Rails work. If you’re a Rails dev who already pays for Copilot, keep it for the autocomplete and add Cursor or Claude Code on top for the heavy lifting.
Windsurf: The Multi-File Refactor Champion
Windsurf’s Cascade agent surprised us. We gave it the multi-tenant SaaS task — “scope every query in this app to Current.account” — and it walked through 23 files, added the scope, updated the tests, and even caught two places where we’d forgotten to scope a find_by. Cursor’s Composer technically did the same task but missed one of the find_by calls. Claude Code got them all but took twice as long.
For pure Rails refactors that touch a lot of files at once, Windsurf is the tool to beat in 2026. Read our full Windsurf vs Claude Code comparison for the broader picture.
The downside: Windsurf is weaker on greenfield Rails code. Ask it to scaffold a new feature from scratch and it’ll write something that works but doesn’t feel quite right — too many before_action callbacks, too few service objects.
Aider: The Terminal Purist’s Pick
Aider is still the best terminal-native AI coding tool, and Rails devs who live in vim or nvim will love it. The diff-based workflow means you see exactly what’s about to change before it touches your repo, which matters a lot when the AI is editing a routes.rb file you spent an hour getting right.
Aider’s Rails output is roughly on par with Cursor’s — slightly better than Copilot, slightly worse than Claude Code. The killer feature is --auto-commits: every AI edit becomes its own git commit, so reverting a bad suggestion is one git reset away. For Rails devs who treat git history as documentation, that’s worth the slightly clunkier UX.
What About Bolt, Lovable, v0?
We tested all three on Rails and the answer is short: don’t. Bolt, Lovable, and v0 are built for JavaScript-first stacks. Bolt can technically scaffold a Rails app in WebContainers but it’s slow and the output is generic. Lovable doesn’t pretend to support Rails. v0 is React-only. Stick with the IDE-and-terminal tools above.
The Rails-Specific Gotchas Every AI Tool Hits
After a week of testing, three issues showed up in almost every tool:
- Solid Queue vs Sidekiq: Tools trained before mid-2024 still default to Sidekiq. Always tell the AI explicitly “we use Solid Queue” or it will add
gem "sidekiq"to your Gemfile. - The new auth generator: Rails 8’s built-in auth generator is so new that most tools either ignore it or try to install Devise. Mention it by name in your prompts.
- Turbo Stream targeting: AIs love writing
turbo_stream.replace "deals"without checking what the actual DOM ID is. Always grep your views first or wrap your prompts with the target ID.
All three are easy to work around once you know about them — and a good code review pass catches them before they hit main.
So Which One Should You Actually Use?
If you write Rails 8 every day and want the best output: Claude Code.
If you want speed and you’ll write a .cursorrules file: Cursor.
If you’re refactoring a big legacy Rails app: Windsurf.
If you live in the terminal: Aider.
If you already pay for Copilot: keep it for autocomplete, layer one of the above on top.
Rails devs have it better in 2026 than they did even a year ago. The tools have finally caught up with Hotwire, Solid Queue is no longer a punchline, and the gap between “AI-generated Rails” and “Rails you’d ship” has closed dramatically. Pick the tool that fits your workflow and you’ll ship faster than you ever did writing Rails by hand.
For the broader picture across every stack we cover, see our best AI coding tools roundup for 2026, the pricing breakdown, and the sibling framework guides for Django, Laravel, FastAPI, Next.js, and React. If you’re picking a language vertical instead of a framework, the Python, TypeScript, Go, and Rust posts are the place to start.