Module: HelenaAdministration::ApplicationHelper
- Defined in:
- app/helpers/helena_administration/application_helper.rb
Instance Method Summary collapse
Instance Method Details
#title(page_title) ⇒ Object
3 4 5 6 |
# File 'app/helpers/helena_administration/application_helper.rb', line 3 def title(page_title) content_for :title, page_title.to_s page_title end |
#truncate_between(str, after = 30) ⇒ Object
adds … in between like if you have to long names in apple finder so you can i.e see the beginning and the suffix
9 10 11 12 |
# File 'app/helpers/helena_administration/application_helper.rb', line 9 def truncate_between(str, after = 30) str = '' if str.nil? str.length > after ? "#{str[0..(after / 2) - 2]}...#{str[(str.length - ((after / 2) - 2))..str.length]}" : str end |