我正在使用预订系统,我正在使用简单的日历宝石...我有一个预订模式,其中包括开始日期和结束日期以及房间......现在,如果客户选择逗留3天,并且他选择了同一个房间,我需要在我简单的日历中显示他住在哪个房间。 2016年10月10日至2016年10月14日 - 2016年10月14日,该特定房间将被选中....但这里的问题是它仅显示当天预订的开始日期和房间,但并未显示其余部分天预订客房... 如何我通过所有的日期如何通过简单日历宝石的开始日期和结束日期之间的所有日期
class Booking < ApplicationRecord
alias_attribute :start_time, :start_date
has_many :booking_rooms, :dependent => :destroy, inverse_of: :booking
has_many :rooms, through: :booking_rooms
end
class BookingRoom < ApplicationRecord
belongs_to :room
belongs_to :booking, inverse_of: :booking_rooms
end
class Room < ApplicationRecord
has_many :booking_rooms
has_many :bookings, through: :booking_rooms
end
我误解你的问题。请张贴相关的型号代码。 – Amadan
谢谢你的回复 – edrich13