What is the difference between Haml and Yaml in Ruby on Rails?

kgangadhar

I am a Ruby on Rails developer, working on this technology from past 7 months. while working on Rails many times i encountered yaml files.

As i encountered yaml(yet another mark-up language) is used to store the static content that needed to load before the server starts( like in I18n language translation ) and some are used as a switch to store 'boolean' values.

Recently in some of SO questions i saw haml used in rails, As far as i know both are mark-up languages. What is the difference between these two and what to prefer and not-to while using rails.

Please shed some light on this :)

Jörg W Mittag

They have nothing to do with each other.

HAML is a markup language for semi-structured documents. Its semantics are essentially equivalent to HTML, and its usage domain is the same. In addition, HAML is also a template language, it allows embedding of arbitrary code in a general-purpose programming language (typically Ruby), similar to ERb.

YAML is a data language. Its semantics are a bit higher-level than JSON (in fact, as of YAML 1.2, YAML is a proper superset of JSON, i.e. every JSON document is also a YAML 1.2 document) and somewhere below XML (as a pure data language, not a document markup language), but its usage domain is the same as both of those.

In short: HAML is a replacement for HTML (and ERb), YAML is a replacement for JSON and XML.

Collected from the Internet

Please contact [email protected] to delete if infringement.

edited at
0

Comments

0 comments
Login to comment

Related

From Dev

What is the difference between = and - in haml while writing ruby code?

From Dev

what is the difference between partials in ruby on rails to React?

From Dev

what is the difference between partials in ruby on rails to React?

From Dev

What is the difference between @user and user in Ruby on Rails?

From Dev

YAML in Ruby. What is the difference between load and load_file?

From Dev

What's wrong with this code in Ruby on Rails and HAML?

From Dev

Difference between <%= ... %> and <% ... %> Ruby on Rails

From Dev

What is the difference between '&&' and '&' in Ruby

From Dev

What is the difference between '&&' and '&' in Ruby

From Dev

What is the difference between '||=' and '=' in Ruby

From Java

What is the difference between YAML and JSON?

From Dev

What's the difference between controllers and actions in ruby on rails?

From Dev

What's the difference between controllers and actions in ruby on rails?

From Dev

What is the best way to calculate difference between TIMESTAMP values in Ruby on Rails

From Dev

What is the difference between :to and => in rails

From Dev

Difference between Markdown and Haml?

From Dev

Difference between Markdown and Haml?

From Dev

What is the difference between .yaml and .yml extension?

From Java

What is the difference between <%, <%=, <%# and -%> in ERB in Rails?

From Dev

What is the difference between the Rails datatypes?

From Dev

Ruby on Rails - Difference between Render and render action:

From Dev

difference between calling create and new() in ruby with rails

From Dev

Difference between 'for' and 'each' Iterators on Ruby on Rails

From Dev

Difference between these creation methods? Ruby on Rails

From Dev

What is the difference between instance&class method include&extend (Ruby, Rails)

From Dev

What is the difference between the "sort" and "sort!" method in ruby?

From Dev

What is the difference between a Ruby Hash and a Python dictionary?

From Dev

Ruby - What is the difference between intern and to_sym

From Dev

What is the difference between a symbol and a variable in Ruby?

Related Related

  1. 1

    What is the difference between = and - in haml while writing ruby code?

  2. 2

    what is the difference between partials in ruby on rails to React?

  3. 3

    what is the difference between partials in ruby on rails to React?

  4. 4

    What is the difference between @user and user in Ruby on Rails?

  5. 5

    YAML in Ruby. What is the difference between load and load_file?

  6. 6

    What's wrong with this code in Ruby on Rails and HAML?

  7. 7

    Difference between <%= ... %> and <% ... %> Ruby on Rails

  8. 8

    What is the difference between '&&' and '&' in Ruby

  9. 9

    What is the difference between '&&' and '&' in Ruby

  10. 10

    What is the difference between '||=' and '=' in Ruby

  11. 11

    What is the difference between YAML and JSON?

  12. 12

    What's the difference between controllers and actions in ruby on rails?

  13. 13

    What's the difference between controllers and actions in ruby on rails?

  14. 14

    What is the best way to calculate difference between TIMESTAMP values in Ruby on Rails

  15. 15

    What is the difference between :to and => in rails

  16. 16

    Difference between Markdown and Haml?

  17. 17

    Difference between Markdown and Haml?

  18. 18

    What is the difference between .yaml and .yml extension?

  19. 19

    What is the difference between <%, <%=, <%# and -%> in ERB in Rails?

  20. 20

    What is the difference between the Rails datatypes?

  21. 21

    Ruby on Rails - Difference between Render and render action:

  22. 22

    difference between calling create and new() in ruby with rails

  23. 23

    Difference between 'for' and 'each' Iterators on Ruby on Rails

  24. 24

    Difference between these creation methods? Ruby on Rails

  25. 25

    What is the difference between instance&class method include&extend (Ruby, Rails)

  26. 26

    What is the difference between the "sort" and "sort!" method in ruby?

  27. 27

    What is the difference between a Ruby Hash and a Python dictionary?

  28. 28

    Ruby - What is the difference between intern and to_sym

  29. 29

    What is the difference between a symbol and a variable in Ruby?

HotTag

Archive