ruby on rails - How to cache data to use in a dashboard page -
in application, after user logs in, redirect dashboard page, can return every time during session. data in page not change during time, need cache somehow.
is rails responsible me, or need manually?
for now, dashboard display, among others, search:
#how many men? @men = horario.joins(:paciente). where(:data => date.today). where(pacientes: {sexo: masculino}).count @total = horario.where(:data => date.today).count @women = @total - @men
if you, i'd use fragment caching dashboard part.
Comments
Post a Comment