We Recommend

Beginning Ruby: From Novice to Professional Beginning Ruby: From Novice to Professional
Beginning Ruby is a thoroughly contemporary guide for every type of reader wanting to learn Ruby, from novice programmers to web developers to Ruby newcomers. It starts by explaining the principles behind object-oriented programming and within a few chapters builds toward creating a genuine Ruby application.


Posted By

cczona on 03/28/08


Tagged

rails ruby haml


Versions (?)


Haml 'nesting within a tag' error


Published in: Ruby 


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

"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."

  1. %p{ :title=> 'stupid example', :style=>'font-weight: bold'}

Report this snippet 

Comments

RSS Icon Subscribe to comments
Posted By: cczona on March 28, 2008

You need to login to post a comment.