7
AleCx04
2d

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.
  • 2
    @AleCx04 what your not ready to take sapper for a spin just yet? 😅
  • 0
    I prefer haml over erb. Minimizes the size of the file which makes it much more readable and its also easier to write.
  • 1
    @M1sf3t i dunno man, scared to jump full on into it
  • 0
    @AleCx04 I got curious about it the other day and glanced over the docs. Actually feel like I halfway understood what I read. Cleared up a couple things concerning organization of the front end as well.

    I'm working on trying to put together a portfolio, think I may make an attempt to figure it out when I get the front end done. My js ability seems to be improving quite a bit faster than my ink skills now thanks to this little compiler, so I'm thinking to focus more on the logical side of things rather than attempt to show off my feeble attempts at art.

    Built this cluster fuck of a puzzle for myself on repl earlier...

    https://svelte.dev/repl/...

    Basically the same 2 variables being used between 3 components in a manner that works but somewhat redundantly. Not really for public consumption of course, more just a pita bomb disarming exercise for me should I happen to forget the flow of props for yet the 100th time 🙄
Your Job Suck?
Get a Better Job
Add Comment