# Methods added to this helper will be available to all templates in the application.
module ApplicationHelper
def my_meta
if @refresh
''
else
''
end
end
def format_selected(st)
%Q! #{st}!
end
def format_unselected(st)
%Q!#{st}!
end
def highlight_first(st)
f=st[0].chr
s=st.dup
s[0]=''
%Q!#{f}! +
%Q!#{s}!
end
def textcolor(rownum)
rownum==@selected_item ? 'white': @color
# rownum==@selected_item ? @selcolor : @color
end
def image_html(pic,size)
#returns pic with html image formatting
if pic.empty?
''
else
image_tag(pic, :size =>size)
end
end
#clean_up takes out only the filename, leaving extn and path
def clean_up st
st.match(/\/([\w ]*)\./)?
$1.upcase.gsub(' ','-') : st
end
end