Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save JulienSansot/cbb983bb952768bfba0c8147612e66a1 to your computer and use it in GitHub Desktop.
Save JulienSansot/cbb983bb952768bfba0c8147612e66a1 to your computer and use it in GitHub Desktop.
rescue_from DashboardErrors::Unauthorized do
respond_to do |format|
format.html { render } # 403
format.html { redirect_to @role }
format.json { render json: { error: "Unauthorized" }, status: :method_not_allowed } # 403
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment