Orta seviye
18 Kasım 2026

Hatayı bul: Ruby on Rails

Tek bir kod parçası. Hatayı bul ya da hata olmadığını kanıtla.

ruby
1class UsersController < ApplicationController
2  def show
3    @user = User.find(params[:id])
4    render json: @user
5  rescue ActiveRecord::RecordNotFound
6    render json: { error: 'User not found' }, status: :not_found
7  end
8end

Soruna yol açan satırlara tıkla.

Kararın

Günde bir deneme. Cevap hemen ardından görünür.

Serini koru

Serini korumak ve ilerlemeni takip etmek için hesap oluştur.

Hesap oluştur