Rails: AbstractController::DoubleRenderError (Render and/or redirect were called multiple times in this action. Please note that you may only call render OR redirect, and at most once per action)
An action called render/redirect_to more than once.
AbstractController::DoubleRenderError (Render and/or redirect were called multiple times in this action. Please note that you may only call render OR redirect, and at most once per action)Render and/or redirect were called multiple times in this actionDoubleRenderError Rails Meaning
Add and return/return after the first render/redirect (redirect_to x and return), restructure conditionals, and check before_action filters that render or redirect and then let the action continue (a callback that renders halts the chain, but only if it renders/redirects itself).
Common causes
redirect_tothen continued execution in the action- Missing
returnafterrenderin a guard clause - Callback renders and the action also renders
- Rescue block rendering after a previous render
- Implicit render plus explicit render
⚡ Quick fix
return redirect_to(root_path) unless user- Use
if/elsebranches with one render each - Check callbacks (
before_action) for render/redirect
Detailed fix by platform
Rails
redirect_to root_path and return if @user.nil?
How to diagnose
- Calls — How many renders?
- Guard — return?
- Callback — Renders?
🔧 Still not fixed?
Many errors look alike. If the steps above didn’t solve it, one of these is probably what you’re facing:
Similar errors
- ActionController::ParameterMissing: param is missing or the value is empty Rails: ActionController::ParameterMissing: param is missing or the value is empty: user
- ActionController::UnknownFormat Rails: ActionController::UnknownFormat — UsersController#show is missing a template for this request format and variant
- ActionView::MissingTemplate: Missing template Rails: ActionView::MissingTemplate (Missing template users/show, application/show with {:locale=>[:en], :formats=>[:html], :handlers=>[:erb, :builder, :raw, :ruby, :jbuilder]})
Most viewed in Ruby / Rails
- ActiveRecord::PendingMigrationError Rails: ActiveRecord::PendingMigrationError — Migrations are pending. To resolve this issue, run: bin/rails db:migrate
- undefined method for nil Ruby: NoMethodError: undefined method `x' for nil (nil:NilClass)
- ActionController::InvalidAuthenticityToken Rails: ActionController::InvalidAuthenticityToken (Can't verify CSRF token authenticity)
Other ways to find it
Where this error sits
Origin: Application & API. Errors that are often confused with or caused by this one (click to open):
🧠 Still stuck? Analyze your error
Paste the full message, response headers or stack trace — we'll detect the platform and point to the most likely cause.
💬 What worked for others
No tips yet — did something else fix this for you?
Share what worked for you
Tips are checked by an editor before they appear. Links are removed.
Report a correction or suggest an improvement
Last updated 5 Nov 2026