2020-08-19から1日間の記事一覧
「app\controllers」フォルダに「reservations_controller.rb」ファイルを新規作成します。 app\controllers\reservations_controller.rb(新規作成したファイル) class ReservationsController < ApplicationController before_action :authenticate_user! d…
コマンド 1文です。 rails g model Reservation user:references room:references start_date:datetime end_date:datetime price:bigint total:bigint コマンド マイグレーション rails db:migrate 記述追加 app\models\room.rb 「has_many :reservations」…