application_helper.rb 365 B

123456789101112131415
  1. module ApplicationHelper
  2. # Returns the full title on a per-page basis.
  3. def full_title(page_title = '')
  4. base_title = "School Platform"
  5. if page_title.empty?
  6. base_title
  7. else
  8. page_title + " | " + base_title
  9. end
  10. end
  11. def format_content(text)
  12. simple_format(text).gsub(/([A-z]+:[^\s<]+)/, '<a href="\0">\0</a>').html_safe
  13. end
  14. end