Module: CommonHelper

Defined in:
app/helpers/common_helper.rb

Instance Method Summary collapse

Instance Method Details



5
6
7
8
9
10
11
12
# File 'app/helpers/common_helper.rb', line 5

def copyright(start_year)
  current_year = Date.today.year
  if current_year > start_year
    "#{start_year} - #{current_year}".html_safe
  else
    "#{current_year}"
  end
end

#hide_style(style = nil) ⇒ Object



14
15
16
# File 'app/helpers/common_helper.rb', line 14

def hide_style(style = nil)
  'display: none;' + style.to_s
end

#ty(text) ⇒ Object



18
19
20
# File 'app/helpers/common_helper.rb', line 18

def ty(text)
  ::StandaloneTypograf::Typograf.new(text, mode: :html).prepare.html_safe
end