about summary refs log tree commit diff stats
path: root/app/helpers/application_helper.rb
blob: 8008b04febba54f8615355c097b0068c067cb178 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
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

end