As I admitted up-front.  This is lack of my HTML skills that is also a
factor.  Having said that,  there were a couple of things that stand
out:

1.  I had the lines:
   %h2
     Sign In
    as
   %h2 Sign In

And I got the Illegal nesting error.  It was not immediately apparent
to me what I was doing wrong.  It still isn't, may be someone can
explain?  I got around it by following examples in the CommunityEngine
codebase and the online documentation.

The second one was more subtle and fortunately by googling, I found
the solution:

2.  In the following line of code

      %span#noscript{:style => "display:none;"}

I had a space between noscript and "{" as shown below:

      %span#noscript {:style => "display:none;"}

Which triggered the same illegal nesting error and made no sense to
me.  If not for Google, I would not have found the solution on my own.

I think that there is a lot of value to Haml way of structuring of the
"view" code.  Having maintained a large Rails application where the
ERB based view code has literally gone wild (the work of previous
programmers), I can see the value in moving the code in helpers where
it belongs and becomes much easier to maintain.  That is what I had to
do to debug the view code.  Plus, it is very easy to loose the sight
of forest and just look at the trees in a long ERB listing which is
not constrained to have a particular indentation and has a lot of
clutter.

I like the friendly spirit of this community.  May be a guide for
newcomers as to what NOT to do, as in above two examples would be
super helpful?  With a powerful tool like Haml, sometimes a set of
guidelines that keeps you out of trouble is more important than what
to do?

Thank you all again for your time and patience.

Regards,

Bharat

p.s.  Tse Yang, your comments are very insightful and I appreciate
them.  The reason I took on a page like this is that I wanted to judge
the value proposition of Haml in a close to real-life setting.  I have
two large Social Networking Open Source applications that I am playing
with:  Insoshi and CommunityEngine.  Insoshi has used "ERB" and
CommunityEngine has chosen to go with Haml, so I was trying to convert
Insoshi to Haml based code.  I am not sure how far will I get, but
worth a try.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"Haml" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/haml?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to