Module: LayoutHelper

Defined in:
app/helpers/layout_helper.rb

Overview

These helper methods can be called in your template to set variables to be used in the layout This module should be included in all views globally, to do so you may need to add this line to your ApplicationController

helper :layout

Instance Method Summary collapse

Instance Method Details

#current_patientObject



28
29
30
# File 'app/helpers/layout_helper.rb', line 28

def current_patient
  @patient
end

#current_physicianObject



36
37
38
# File 'app/helpers/layout_helper.rb', line 36

def current_physician
  @physician
end

#has_current_patient?Boolean



24
25
26
# File 'app/helpers/layout_helper.rb', line 24

def has_current_patient?
  !@patient.nil?
end

#has_current_physician?Boolean



32
33
34
# File 'app/helpers/layout_helper.rb', line 32

def has_current_physician?
  !@physician.nil?
end

#javascript(*args) ⇒ Object



20
21
22
# File 'app/helpers/layout_helper.rb', line 20

def javascript(*args)
  content_for(:head) { javascript_include_tag(*args) }
end

#show_title?Boolean



12
13
14
# File 'app/helpers/layout_helper.rb', line 12

def show_title?
  @show_title
end

#stylesheet(*args) ⇒ Object



16
17
18
# File 'app/helpers/layout_helper.rb', line 16

def stylesheet(*args)
  content_for(:head) { stylesheet_link_tag(*args) }
end

#title(page_title, show_title = true) ⇒ Object



7
8
9
10
# File 'app/helpers/layout_helper.rb', line 7

def title(page_title, show_title = true)
  content_for(:title) { h(page_title.to_s) }
  @show_title = show_title
end