動作確認環境
- Windows10(x64)
- rails 6.1.7
- ruby 3.0.4p208
app\controllers\application_controller.rbを編集する
class ApplicationController < ActionController::Base
def first
render html: "First!"
end
end
config\routes.rb を編集する
Rails.application.routes.draw do
# For details on the DSL available within this file, see https://guides.rubyonrails.org/routing.html
root 'application#first'
end
上記のように修正し、rails s を実行してブラウザで開くと以下のような感じになる

作成したエンドポイントはプロジェクトのルートディレクトリで「rails routes」コマンドを実行すると確認することができます。
