Ruby on Rails Thursday, June 30, 2016

This solution gives an error:
undefined local variable or method `date' for #<AppointmentsController:

@appointment = Appointment.where("date = ? && timeslot = ?", date,
timeslot).first_or_initialize

Basically, I want to not create double appointments for the same date
and time, and I want to save them if they're not double bookings.

There must be an easier way??

--
Posted via http://www.ruby-forum.com/.

--
You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group.
To unsubscribe from this group and stop receiving emails from it, send an email to rubyonrails-talk+unsubscribe@googlegroups.com.
To post to this group, send email to rubyonrails-talk@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/rubyonrails-talk/48089a9e997a04e20d63ca77d86c3559%40ruby-forum.com.
For more options, visit https://groups.google.com/d/optout.

No comments:

Post a Comment