From 4c5812fd3692e9ec2d5b756cfac6c413869c35c3 Mon Sep 17 00:00:00 2001 From: Matt Wildig Date: Fri, 14 Feb 2014 23:16:55 +0000 Subject: [PATCH] Document recursive nature of hash attr expansion --- REFERENCE.md | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/REFERENCE.md b/REFERENCE.md index 52a41b7d..7832870a 100644 --- a/REFERENCE.md +++ b/REFERENCE.md @@ -419,6 +419,16 @@ and the output will be rendered as: Posts By Author +This expansion of hashes is recursive – any value of the child hash that is +itself a hash will create an attribute for each entry, with the attribute name +prefixed with all ancestor keys. For example: + + .book-info{:data => {:book => {:id => 123, :genre => 'programming'}, :category => 7}} + +will render as: + +
+ ### Class and ID: `.` and `#` The period and pound sign are borrowed from CSS. They are used as shortcuts to