foodsoft/app/helpers/articles_helper.rb
2009-02-10 13:26:10 +01:00

14 lines
No EOL
450 B
Ruby

module ArticlesHelper
# useful for highlighting attributes, when synchronizing articles
def highlight_new(unequal_attributes, attribute)
unequal_attributes.detect {|a| a == attribute} ? "background-color: yellow" : ""
end
def row_classes(article)
classes = " click-me"
classes += " unavailable" if !article.availability
classes += " just_updated" if @article.recently_updated && @article.availability
classes
end
end