7
AleCx04
5y

For my peeps in the RoR arena, did y'all ever felt the need to change from ERB as yout server side rendering engine of choice?

I find it hard to use anything else, i would normally stick to it unless I was using Rails as an API and leave the frontend to React or Vue.

Asking about y'alls opinion because I knew about HAML from a while back. But never really used it and I find Rails with ERB to be really efficient.

Ruby pagebuilding with ERB is really flipping comfortable man.ERB has been my favorite for years.

Currently migrating a project to use Svelte and wanted to see what some of y'all think about Haml or erb. Just for the sake of curiosity. Don't know how many rails users we have in here.

Comments
  • 3
    I think miss @Root does 🤔
  • 4
    Erb is friendly and easy. I've never had a problem with it. It does what it's supposed to, does it well, and doesn't do anything extra.

    I didn't like HAML much, but it's been so long I can't remember why. I hate significant whitespace, so that's probably most of it. It is, however, much more ruby-like, which gives it some definite points.

    There are other choices too, like slim, but I think most of the rest have died. (Like Shoes 😅). Slim is the other big alternative, and is ostensibly faster than erb/haml. Though I found myself hating it for several reasons, notably needing a filthy hack to inject rails data into JS. I don't remember all of the reasons, but I'd ranted about Slim many times while working with it. But maybe it's less terrible now? It has been several years, so it's worth checking out if you're strongly considering haml.
  • 1
    @Root I have never found any reason to not use ERB, was not really looking for an alternative since I pretty much have it in the form of JS frontends, but I really wanted to know the opinion of other experienced Rails devs regarding this one.
  • 0
    I prefer haml over erb. Minimizes the size of the file which makes it much more readable and its also easier to write.
  • 0
    @M1sf3t i dunno man, scared to jump full on into it
Add Comment