David Kimura PRO
Joined 7/18/2015
Drifting Ruby Owner
Ruby Rogues Panelist
David Kimura PRO said almost 8 years ago on FullCalendar Events and Scheduling :

Gotcha. It does make sense.

In that case, I would send an additional parameter with the JSON response of whether or not a day is blocked (which is calculated on the server side).

You can use the dayRender callback to change the color of a particular day based on the blocked days. Depending on how you are allowing new event creations, you would want to handle the validation there as well as the backend on the model.

This does get a bit tricky since you're having to validate on server side and render on client side as well.

Also check out this JSFiddle where they're adding a class to a date, dynamically, after the calendar is rendered.


David Kimura PRO said almost 8 years ago on FullCalendar Events and Scheduling :

Yeah, I'd calculate it on the server side and then pass the blocked days through the JSON render request. On the client side, put in the results of the client side validation. Overall, you just want to make sure that you're aren't allowing a client to go through a whole event record creation, only to tell them something that you already knew and could have told them from the beginning; that enrollment for that day is already filled.


David Kimura PRO said almost 8 years ago on FullCalendar Events and Scheduling :

You could do something like this

class LeaveEvent < ActiveRecord::Base
  scope :events_on_date, -> (date)  { where('start_time <= ? AND end_time >= ?', date, date).size }
 ...
end

Then use the scope within the JSON builder.


David Kimura PRO said almost 8 years ago on Searchkick & elastic search :
I definitely have this on my list of upcoming episodes. Stay tuned! The next episode(s), I'm planning on covering sidekiq, but searchkick will soon follow.

David Kimura PRO said almost 8 years ago on Rails API - Authentication with JWT :

It looks like it was from where the TokenController was getting parsed.

https://github.com/nsarno/knock/commit/ed467d1e3e70dde5b4a367ac1b73dcf48ae4cebb