Im trying to implement a Medic Online Date System with a fullCalendar on ruby on rails. (College Project) need help please.
So the real question is this. If i have 2 medics, example Alex and Alfred and Alex User_id = 1 and Alfred User_id = 2. If Alex is logged in my Medic Online System as User_id 1, fullCalendar will show only User_id = 1 appointments and not all of the medics appointments, and viceverse with Alfred, if im logged in with Alfred's account fullCalendar then will show me only Alfred's appointments.
Note: All my database is fully functionally with users_id but i have NO CLUE how to validate this id to show different medics appointments and not all the medic appointments.
Thanks!
When you log in store the user_id in a session:
session[:user_id]=user.id
in your application controller
Now you can user
current_user
in your views or controllersUse the ID to filter out the events. Check out the CanCanCan gem, or if this is as simple as it gets then do