Make multiple conditions in if expression more readable My logic has to be written in this way, but I think the if expression is too long to read.

How can I make it more readable?

  if @tool_cvt_video_info_test.save and check_and_update_firmware_model_and_version(params["camera_ip"]) and save_uploaded(params[:videos])

    format.html { redirect_to @tool_cvt_video_info_test, notice: 'Video info test was successfully created.' }
    format.json { render action: 'show', status: :created, location: @tool_cvt_video_info_test }
  else
    format.html { render action: 'new' }
    format.json { render json: @tool_cvt_video_info_test.errors, status: :unprocessable_entity }
  end
Given the little context you have provided in the question, there isn't much to recommend, other than whitespace changes.

if  @tool_cvt_video_info_test.save and
    check_and_update_firmware_model_and_version(params["camera_ip"]) and
    save_uploaded(params[:videos])
  format.html {
    redirect_to @tool_cvt_video_info_test,
    notice: 'Video info test was successfully created.'
  }
  format.json {
    render action: 'show',
    status: :created,
    location: @tool_cvt_video_info_test
  }
else
  format.html { render action: 'new' }
  format.json {
    render json: @tool_cvt_video_info_test.errors,
    status: :unprocessable_entity
  }
end


I am a bit suspicious of this code, though.  It's saving some information about a video test, possibly updating the camera's firmware, and saving an uploaded video?  That's a lot of functionality to put in one if-condition, and if anything goes wrong, the user probably won't get sufficient feedback as to exactly what failed.