2
araes 3 days ago

Thanks, confusion about the application and the intended use cases seems to be a common issue among other comments.

Initially thought it was an addon (or JS lib) that allowed for using Ruby as an embedded client-side scripting language that would parse in-line Ruby in the HTML.

Clearer once I realized it was closer to PHP or similar language usages.

Second also to the recommendation about a quick definition of ERB (Embedded RuBy). Had to look it up.

A few practical examples of what an actual user might want to do with HTML + ERB could be helpful.

  - Client characteristics customization
  - Previous use history customization
  - The database Create, Read, Update, and Delete cycle using Herb
  - A basic Content Management System example
  - A basic e-commerce example
  - A basic RESTful API example
Note: These are just my guesses based on what I "believe" its for.

runako 3 days ago

ERB is a server-side templating language. It's akin to PHP, Jinja for Python, JSP (Java), ASP.NET Web Pages, etc.

What these do is let you do things like turn a collection of objects into a the HTML for a table and send that over the wire. The client then just has time to display the table and not assemble it from e.g. JSON. ERB and similar allow you to build dynamic sites without using any Javascript at all.

To a first-order approximation, any dynamic site that does not use React or Angular will use a templating language like ERB.

rubyfan 3 days ago

This explanation makes me a bit sad.

> What these do is let you do things like turn a collection of objects into a the HTML for a table and send that over the wire. The client then just has time to display the table and not assemble it from e.g. JSON.

runako 2 days ago

I'm sorry, I guess?

Typo aside, I did try to capture the essential difference of a server-side templating engine vs. how many people build using "modern" web stacks.

rubyfan 2 days ago

Yeah, this what makes me sad. Your premise is that SPA is the default for web development and you imply server side rendering is not “modern”.

runako 2 days ago

Disclaimer: I don't like SPAs, and I think the "modern" web stack is a niche set of technologies that are being widely overused. (This is why I put "modern" in quotes.)

But I have worked with enough engineers schooled since React became popular to know that the "modern" Web stack basically is SPAs everywhere.

Incidentally, this same evolution has made SQL something of a dark art among programmers. It's good that the field is big and diverse and specialized! But also, there are tons of professional full-stack Web programmers who are functionally illiterate in SQL due to primarily using NoSQLs or ORMs.

Natsu 3 days ago

Thanks for that, I'm used to ERB referring to Epic Rap Battles of History.