Class: Renalware::Patients::MessagesComponent

Inherits:
ApplicationComponent show all
Includes:
Pagy::Backend, Pagy::Frontend, ToggleHelper
Defined in:
app/components/renalware/patients/messages_component.rb

Instance Method Summary collapse

Methods included from ToggleHelper

#css_toggle_link_to, #row_toggler, #rows_toggler, #table_toggler, #td_toggle_row, #th_toggle_all_rows, #toggler

Methods inherited from ApplicationComponent

#policy, #renalware

Instance Method Details

#formatted_title(title) ⇒ Object



22
23
24
25
26
27
28
# File 'app/components/renalware/patients/messages_component.rb', line 22

def formatted_title(title)
  if pagination.items < pagination.count
    "#{title} (#{pagination.items} of #{pagination.count})"
  else
    "#{title} (#{pagination.count})"
  end
end

#messagesObject



17
18
19
20
# File 'app/components/renalware/patients/messages_component.rb', line 17

def messages
  load_messages unless @messages
  @messages
end

#paginationObject



12
13
14
15
# File 'app/components/renalware/patients/messages_component.rb', line 12

def pagination
  load_messages unless @pagination
  @pagination
end