about summary refs log tree commit diff stats
path: root/app/helpers/application_helper.rb
blob: f12cdd4710a78e4bebccd5e48af9f3433d35796c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
module ApplicationHelper

  def title(text)
    content_for :title, text
  end

  def sortable(col, title = nil)
    title ||= col.titleize
    css_class = (col == sort_column) ? "current #{sort_direction}" : nil
    direction = (col == sort_column and sort_direction == "asc") ? "desc" : "asc"
    link_to title, {:sort => col, :dir => direction}, {:class => css_class}
  end

  def markdown(text)
    options = %i[]
    Markdown.new(text, *options).to_html.html_safe
  end

end