New to ruby and react, having an issue

I am totally new to ruby, and have been going at this bug for hours to no avail. Where is the issue, or how can I go about understanding it better to find it on my own?

Error:
ActionController::RoutingError (uninitialized constant Api

  Object.const_get(camel_cased_word)
        ^^^^^^^^^^

        raise MissingController.new(error.message, error.name)
        ^^^^^):

routes.rb:

Rails.application.routes.draw do
  get 'welcome/index'

  namespace :api, defaults: { format: 'json' } do
    namespace :v1 do
      resources :guests, only: %i[create]
    end
  end

  root 'welcome#index'
end

guests_controller.rb:

class Api::V1::GuestsController < Api::V1::BaseController
  def create
    @guest = Guest.new(guest_params)
    if @guest.save
      render json: { message: 'Success! Welcome, ' + @guest.full_name }, status: :created
    else
      render json: { errors: @guest.errors }, status: :bad_request
    end
  end

  private

  def guest_params
    params.require(:guest).permit(:full_name, :phone_number)
  end
end

Guest.js:

import React, { useState } from 'react';
import axios from 'axios';

const Guest = () => {
  const [fullName, setFullName] = useState('');
  const [phoneNumber, setPhoneNumber] = useState('');
  const [fullNameError, setFullNameError] = useState('');
  const [phoneNumberError, setPhoneNumberError] = useState('');

  const handleSubmit = (e) => {
    e.preventDefault();

    const validPhoneNumberRegex = /^d{10,11}$/;

    if (fullName.trim().split(' ').length !== 2) {
      setFullNameError('*must be your first and last name');
    } else {
      setFullNameError('');
    }

    if (!validPhoneNumberRegex.test(phoneNumber)) {
      setPhoneNumberError('*must be numbers only (ex. 1231231234)');
    } else {
      setPhoneNumberError('');
    }

    if (fullName.trim().split(' ').length == 2 && validPhoneNumberRegex.test(phoneNumber)) {
      alert(`Success! Welcome, ${fullName}.`);
      axios.post('http://localhost:3000/api/v1/guests', {
        full_name: fullName,
        phone_number: phoneNumber
      })
        .then((response) => {
          alert(response.data.message);
        })
        .catch((error) => {
          console.error(error);
        });
    }
  };

  const handleChange = (e) => {
    const { name, value } = e.target;
    if (name === 'fullName') {
      setFullName(value);
    } else if (name === 'phoneNumber') {
      setPhoneNumber(value);
    }
  };

  return (
    <div className="guest">
      <h1 className="guest__title">Welcome</h1>
      <p className="guest__subtitle">
        Please provide your full name and phone number.
      </p>
      <form onSubmit={handleSubmit}>
        <div>
          <label htmlFor="fullName">Full Name:</label>
          <input
            type="text"
            id="fullName"
            name="fullName"
            className={`${fullNameError ? 'error' : ''}`}
            value={fullName}
            onChange={handleChange}
            placeholder="Please enter your full name"
          />
          {fullNameError && (
            <div className="error-message">{fullNameError}</div>
          )}
        </div>
        <div>
          <label htmlFor="phoneNumber">Phone Number:</label>
          <input
            type="text"
            id="phoneNumber"
            name="phoneNumber"
            className={`${phoneNumberError ? 'error' : ''}`}
            value={phoneNumber}
            onChange={handleChange}
            placeholder="Your Phone Number"
          />
          {phoneNumberError && (
            <div className="error-message">{phoneNumberError}</div>
          )}
        </div>
        <button type="submit">View Menu</button>
      </form>
    </div>
  );
};

export default Guest;

Trying to create my first post request, not working.

New contributor

Chris Capone is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật