I'm looking up how HAML works and I've found documentation that assumes an understanding of ERB. I know nothing other than it relates to Ruby. I also know very little about ruby. I don't deal with server side languages often but when I do it's PHP. Can anyone give me a summary of ERB? I'd like to start working with HAML and so I think I need to understand a few things first.
ERB is Embedded Ruby. It is often used to embed Ruby code in an HTML document within Rails.
HAML is a RubyGem which is essentially the same thing as ERB but with a different syntax.
Here is a sample of ERB:
<[B]h1><[B]%= post.title %></[B]h1>
<[B]h2><[B]%= post.subtitle %></[B]h2>
<[B]%= post.content %>
Here is the same code converted to HAML:
This topic is now closed. New replies are no longer allowed.