What to use .haml or .erb?

Hi all,

I have just move towards to learn Ajax . Before learning Ajax one big
question raised to me what to use haml or erb.
From day one of Rails, i have used only .erb files.
I read DRY feature of haml and haml really impress me.

I really wish to use haml .

Before use i raised some questions :-
1 . Is there are more advantage execluding dry feature of haml over
erb.
2 . Is there any limitation or drawback of haml .
3. Give me some quick start to Ajax but should be simple because i have
only theoretically knowledge of Ajax.

Thanks

Best Regards
Fahim Babar Patel

Fahim P. ha scritto:

Before use i raised some questions :-
1 . Is there are more advantage execluding dry feature of haml over erb.
2 . Is there any limitation or drawback of haml .
3. Give me some quick start to Ajax but should be simple because i have
only theoretically knowledge of Ajax.

I always use .erb but in the last project I had to use haml. of course
it has a dry syntax, but my opinion is that it distorts the concept of
templating language. The use of haml makes you learn another syntax
different from html, but a view, at the end, is html…
I don’t like it much :slight_smile:

On 7 November 2012 09:12, Tommaso V. [email protected]
wrote:

has a dry syntax, but my opinion is that it distorts the concept of
templating language. The use of haml makes you learn another syntax
different from html, but a view, at the end, is html…
I don’t like it much :slight_smile:

I think haml is excellent and much prefer it to erb. But that just
shows that different tools suite different people. OP try it yourself
and use whichever one you prefer. Either will do the job.

Colin

On Wednesday, November 7, 2012 3:15:55 PM UTC+5:30, Colin L. wrote:

question raised to me what to use haml or erb.
only theoretically knowledge of Ajax.
shows that different tools suite different people. OP try it yourself
and use whichever one you prefer. Either will do the job.

Colin

Thanks lot reply.

I waiting for reply on this question.

  1. Give me some quick start to Ajax but should be simple because i have
    only theoretically knowledge of Ajax.

On 7 November 2012 10:03, Fahim P. [email protected] wrote:

2 . Is there any limitation or drawback of haml .

I waiting for reply on this question.

  1. Give me some quick start to Ajax but should be simple because i have only
    theoretically knowledge of Ajax.

That is why it is best to only ask questions on one subject at a time.
I would start by using google, I am sure it will find lots of useful
stuff. A search for
rails ajax tutorial
looks like a good start. If you already understand the theory you
should have few problems.

Colin

Performance wise its 10 time faster than ERB… :slight_smile:

http://www.slideshare.net/graffzon/haml-vs-erb

On Wed, Nov 7, 2012 at 2:42 PM, Tommaso V.
<removed_e[email protected]

wrote:

has a dry syntax, but my opinion is that it distorts the concept of
To unsubscribe from this group, send email to

[email protected]**googlegroups.com[email protected]

.
For more options, visit
https://groups.google.com/**groups/opt_outhttps://groups.google.com/groups/opt_out
.


Thanks, Vibin…

I use both, but prefer haml, because it’s concise.

2012/11/7 Fahim P. [email protected]

On 7 November 2012 09:21, Vibin [email protected] wrote:

Performance wise its 10 time faster than ERB… :slight_smile:

http://www.slideshare.net/graffzon/haml-vs-erb

I think you mis-counted the zeros. It suggests haml take 1.5 times as
long erb. However it is irrelevant either way as only a tiny
proportion of the total time is spent rendering either erb or haml.

Colin

I’m pretty new to rails, barely six months old in rails and I prefer
haml
to erb.

I’ve read about some ways to convert erbs to hamls, just in case you
plan
to switch completely to haml.

On Wed, Nov 7, 2012 at 4:35 AM, Иван Бишевац [email protected]
wrote:

I use both, but prefer haml, because it’s concise.

I normally give clients a decision when the project starts (or make my
own based on what they express their technical skill to be at the
start of a project.) In short what I tell clients is “Do you know much
about HTML? Does learning something new really bug you or do you want
to work with what you know?” Those two questions help me decide
whether to use HAML which is concise like the above quote states or
use ERB which has a far less learning curve and for technology
disinclined people who know basic HTML, does not lock them out of
their own views.

For the performance issues, to me that matters not one bit considering
I do fragment caching and I do full caching depending on the page so
at that point the argument is moot, unless you are dynamically serving
every one of your pages dynamically which is ignorant to do even on a
small site. So in short the issues about “speed” in my eyes are
immature and ignorant to modern caching techniques for dynamic sites.

Check out Backbone.JS or Spine JS. (Newcommers will find Backbone’s
documentation better, but I’ve actually switched to Spine which I like
certain parts of better).

For front-end tempting, you’ll probably want .haml.jst. check these out

http://stackoverflow.com/questions/5254396/best-strategy-to-use-haml-template-with-backbone-js

https://github.com/netzpirat/haml_coffee_assets

This used to be how we did used haml with JST, but the repo is gone :frowning:

https://github.com/infbio/haml_assets/

This email will make much more sense once you learn what “JST” is.

This forum is not affiliated to the Ruby language, Ruby on Rails framework, nor any Ruby applications discussed here.

| Privacy Policy | Terms of Service | Remote Ruby Jobs