Hello there,
I was just wondering why some of the rails views are .haml, and some others (like the landing_page) are .erb. Wouldn’t be simpler to have everything following one templating engine? (Just out of curiosity).
Thanks,
Facundo
Hello there,
I was just wondering why some of the rails views are .haml, and some others (like the landing_page) are .erb. Wouldn’t be simpler to have everything following one templating engine? (Just out of curiosity).
Thanks,
Facundo
Well, you are absolutely right It would be definitely simpler to have only one templating engine in use.
To recap, we actually have 3 different ways to render HTML:
Some time ago we decided to move towards React. The new features will be built on it. In addition to that, we decided that new features that will use mostly server rendered content (landing page is a good example) will prefer ERB over HAML. HAML is what we have used in the past.
So the preference is to move towards React and ERB. We have no plans to convert old HAML views to ERB. It would require too much effort + we can’t afford the possible regressions it might cause in production.
I’m not going into the details why we nowadays prefer ERB over HAML. That would be a great starting point for a flame war, and I’m not a flame war type of guy Googling ERB vs HAML will probably give a lot of articles describing the pros and cons of both.