Forum: Ruby Props - Nokogiri's Builder notation has class and ID shortcuts

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
Aafa8848c4b764f080b1b31a51eab73d?d=identicon&s=25 Phlip (Guest)
on 2009-03-24 13:16
(Received via mailing list)

This is just a note to document a nice discovery in Nokogiri's tests:

         builder = do
           div.rad.thing! {
             text "<awesome>"
             b "hello"
           '<div class="rad"
                      builder.doc.root.to_html.gsub(/\n/, ''))

The Builder notation div.rad.thing! expanded to <div class="rad"
This implies .rad, without a bang, expands to class="rad", and .thing!,
with the
bang, expands to an ID.

This topic is locked and can not be replied to.