mailr/app/helpers/contacts_helper.rb

18 lines
505 B
Ruby
Raw Normal View History

2011-07-29 20:05:47 +02:00
module ContactsHelper
2011-08-16 20:05:58 +02:00
def contacts_table_header
html = ""
$defaults["contacts_table_fields"].each do |f|
html << "<th>"
if params[:sort_field] == f
params[:sort_dir].nil? ? dir = 'desc' : dir = nil
end
html << link_to(Contact.human_attribute_name(f), {:controller => 'contacts',:action => 'index',:sort_field => f,:sort_dir => dir}, {:class=>"header"})
html << "</th>"
end
html
end
2011-07-29 20:05:47 +02:00
end