tandusrl / acts_as_bookable

A reservation plugin for Rails applications that allows resources to be bookable.
MIT License
140 stars 103 forks source link

How do you properly build forms for this gem? #25

Open Lubmes opened 7 years ago

Lubmes commented 7 years ago

Before applying a book! on an instance I need to fill in a form. This form to my understanding doesn't need to store the time_start and the time_end in the database, so how would I do this? Stuff did work with hard coding the times with some 'plain old ruby'.

Currently I keep on getting "Interval not available". I made sure my times are converted to DateTime, but still not working.

Maybe you guys could support this issue which I am sure is very fundamental to many, by adding some supporting guidance? I would be very thankful.

class Renting < ApplicationRecord
  # renting is purely for form data handling
  attribute :time_start, :datetime
  attribute :time_end, :datetime
end

This gave a TimeWithZone object still, so to be sure I used .to_datetime on it, but to no avail.