Modifying attributes with Hpricot
by Sean Cribbs
If you’re processing HTML with Hpricot and want to change the
attributes on a tag in a search
block, beware that the attributes
method on an element returns a copy of the actual attributes. In
order to change the real attribute on the element, you need to set
raw_attributes
on it. Here’s what I had to do, boiled down to the
scum on the pan: