Module: SubjectsHelper

Defined in:
app/helpers/subjects_helper.rb

Constant Summary collapse

NAME_MAX_LENGTH =
30

Instance Method Summary collapse

Instance Method Details

Return a link to this subject with the name



6
7
8
# File 'app/helpers/subjects_helper.rb', line 6

def link_name(subject, options = {})
  link_to subject.name, subject, options
end

#truncate_name(name, options = {}) ⇒ Object

Return the truncated name



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

def truncate_name(name, options={})
  options = {:length => NAME_MAX_LENGTH, :separator => ' '}.merge options
  h truncate(name,options)
end