ruby.social is one of the many independent Mastodon servers you can use to participate in the fediverse.
If you are interested in the Ruby programming language, come join us! Tell us about yourself when signing up. If you just want to join Mastodon, another server will be a better place for you.

Administered by:

Server stats:

1.1K
active users

What it looks like in a nutshell:

\posts.each do |post|
<h1 \class(active: post.active?)>\= post.title</h1>
\end

@soulcutter I think phlex is great and I'm glad it's out there! I like templates though, and I work on apps that use them where phlex is too big of a stretch, we deserve nicer things too 🙂

@kaspth I guess I see Phlex as templates! I get where you’re coming from

@kaspth Have you ever seen mote from Soveran? It has weird backtraces because of how it works (ERB goes to great lengths to preserve newlines to ensure exceptions show correct lines) but the implementation is beautiful and incredibly concise.

Your implementation looks similar to mote in some ways.

ie.
% posts.each do |post|
% end

@adam12 interesting! I didn't know about this, thank you

@ufuk ok I would not have thought there'd be a link to C# on this 😄 — I can see what you mean though!

@kaspth view component isn’t my thing so I don’t have a dog this hunt. but being a big fan and advocate of ERB/HTML template and having thoughts/feels about syntax, I thought I’d jump in.

To me the slashes are harsh, aesthetically. They just trigger escaping and regexes to my eyes.

FWIW, if it helps at all, @evanphx and designed and made a templating language called Dang. If there’s anything in Dang that you can use/take/inspo from… it’s yours.

github.com/veganstraightedge/d

GitHubGitHub - veganstraightedge/dang: Another Dang Templating LanguageAnother Dang Templating Language. Contribute to veganstraightedge/dang development by creating an account on GitHub.

@veganstraightedge this isn't meant just for ViewComponent, but just for anybody who uses ERB. I've been developing it over here for instance: github.com/bullet-train-co/nic

That's on point! You're escaping from static HTML into dynamic Ruby, so it's meant to highlight where you're doing that a little more.

Oh Dang, that's awesome, thank you!

GitHubBRB templates: be right back to ERB by kaspth · Pull Request #91 · bullet-train-co/nice_partialsThis is just a test for a templating idea I've had for a while. ERB tags <% %> and <%= %> feel so noisy, having to add %> a Ruby line feels as if I'd had to write ; to end my...

@kaspth if you can use any of Dang or what to take it over as maintainer…

@evanphx never really did anything with it after designing it (me) and implementing it (him).

If you want it, I'd happily give it to you.

@veganstraightedge thanks, I haven't had a chance to look yet!

I don't think I want to be a maintainer 🙂

@veganstraightedge I don't even know if my versionif this is going to work, or if people want that 😄