Module: ApplicationHelper

Includes:
StringHelper
Included in:
ActiveMigration::Transformer::GroupedFieldFixedSpelling
Defined in:
app/helpers/application_helper.rb

Instance Method Summary collapse

Methods included from StringHelper

#name_or_empty, #name_or_nothing

Instance Method Details

#full_title(page_title) ⇒ Object

Returns the full title on a per-page basis.



8
9
10
11
12
13
14
15
# File 'app/helpers/application_helper.rb', line 8

def full_title(page_title)
  base_title = I18n.t("crm.title.full")
  if page_title.empty?
    base_title
  else
    "#{base_title} | #{page_title}"
  end
end

#pluralize_without_count(count, noun, text = nil) ⇒ Object



21
22
23
24
25
# File 'app/helpers/application_helper.rb', line 21

def pluralize_without_count(count, noun, text = nil)
  if count != 0
    count == 1 ? "#{noun}#{text}" : "#{noun.pluralize}#{text}"
  end
end

#puts_on_file(file, string = nil) ⇒ Object



27
28
29
30
31
# File 'app/helpers/application_helper.rb', line 27

def puts_on_file(file, string=nil)
  aFile = File.new(file, "w")
  aFile.write(string || yield)
  aFile.close
end

#titleObject



17
18
19
# File 'app/helpers/application_helper.rb', line 17

def title()
  I18n.t("crm.title.small")
end