Haml 'nesting within a tag' error


/ Published in: Ruby
Save to your folder(s)

"When using haml, an HTML tag is represented using %tagname, but in the case of an HTML tag with attributes, the representation is %tagname{:attribute => value}.

It turns out there must be no whitespace between %tagname and {:attribute => value}. This was the source of a lot of errors when I was trying to write haml forms, since the error message was the cryptic: Illegal Nesting: Nesting within a tag that already has content is illegal."


Copy this code and paste it in your HTML
  1. %p{ :title=> 'stupid example', :style=>'font-weight: bold'}

URL: https://elitefrontier.org/elgg/rordev/weblog/92.html

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.