Module: SubjectsHelper
- Defined in:
- app/helpers/subjects_helper.rb
Constant Summary collapse
- NAME_MAX_LENGTH =
30
Instance Method Summary collapse
-
#link_name(subject, options = {}) ⇒ Object
Return a link to this subject with the name.
-
#truncate_name(name, options = {}) ⇒ Object
Return the truncated name.
Instance Method Details
#link_name(subject, options = {}) ⇒ Object
Return a link to this subject with the name
6 7 8 |
# File 'app/helpers/subjects_helper.rb', line 6 def link_name(subject, = {}) link_to subject.name, subject, 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, ={}) = {:length => NAME_MAX_LENGTH, :separator => ' '}.merge h truncate(name,) end |