Skip to content

Instantly share code, notes, and snippets.

@aghyad
Last active December 28, 2016 08:54
Show Gist options
  • Save aghyad/8026216 to your computer and use it in GitHub Desktop.
Save aghyad/8026216 to your computer and use it in GitHub Desktop.
Crash course in HAML
- is used where you would normally use <%
= is used where you would normally use <%=
% A percentage sign is HTML tags. Like: %h1 , %ul , %li
# A hash is the name of an id of a div tag. For example, #comment is for id="comment"
. A period is for the name of a class of a div tag. For example, .comment is for the class="comment"
!!! is added at the top of a new doc to generate <!DOCTYPE html .....>
And it's ALL based on indentation, like python.
For example:
!!!
%html
%head
%title Todo
= stylesheet_link_tag "application", media: "all"
= javascript_include_tag "application"
= csrf_meta_tags
%body
= yield
- See more at: http://arubystory.blogspot.com/2013/12/tutorial-creating-simple-todo.html#sthash.oa4UIQ5p.dpuf
For more info: http://haml.info/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment