Refactoring a HTML class collector?
Notes:


This tap usage is not uncommon to see but IMHO it's very, very dubious. You can use a functional approach (see code below).
I wouldn't return the string along with the attribute, just the array of classes (which Rails3 helpers understand).


I'd write:

def tr_classes(user)
  [
    ("error" if !user.company),
    ("disabled" if user.disabled?),
  ].compact.presence
end


Tables are usually easier to build from helpers. You now would use the function that way:

content_tag(:tr, :class =&gt; tr_classes(user)) do
  content_tag(:td, user.name)
end