Code Room
Code reviewHardcr-g435
Subject Mass assignmentLevel Senior–Staff~22 minCommon in Code quality & review interviewsIndustries Software development

Question

Review this Ruby on Rails users controller.

What a strong answer looks like

Separate real bugs from style. Rank issues by severity, point at the root cause rather than the symptom, and suggest a concrete fix — specific and kind.

Talk through your review
Code to reviewruby
class UsersController < ApplicationController  def update    @user = User.find(params[:id])    if @user.update(user_params)      render json: @user    else      render json: @user.errors, status: :unprocessable_entity    end  end   private   def user_params    params.require(:user).permit!  endend
Run or narrate your approach, then ask the coach.