public Method

Elements.before(str = nil, &blk)

Add some HTML just previous to each element in this list. Pass in an HTML str, which is turned into Hpricot elements.

Source Code

# File hpricot/elements.rb, line 144
def before(str = nil, &blk)
  each { |x| x.parent.insert_before Hpricot.make(str, &blk), x }
end
Comments

Have your say
Please use Textile formatting (click here for a cheat sheet). Use <code/> and <pre/> for code samples.
Click here to login with OpenID to to post comments.