Live data from Hacker News

Brut: A New Web Framework for Ruby

naildrivin5.com

41–50 of 88 posts

Re: Brut: A New Web Framework for Ruby

#41

I like the emphasis on forms and pages. That's the approach I take in my apps. Forms and Links drive all interaction. Any JavaScript enhancements merely click an existing form (even if it's hidden). You can always inspect the HTML and know exactly the route that will handle the interaction. I think controllers are overused. It's really forms, models (backend) and views (Pages). A lot of the validation and ceremony of…

Is there a reason you literally simulate a click event on the form instead of calling submit() on it?

Re: Brut: A New Web Framework for Ruby

#43

I like the emphasis on forms and pages. That's the approach I take in my apps. Forms and Links drive all interaction. Any JavaScript enhancements merely click an existing form (even if it's hidden). You can always inspect the HTML and know exactly the route that will handle the interaction. I think controllers are overused. It's really forms, models (backend) and views (Pages). A lot of the validation and ceremony of…

Is there a reason you literally simulate a click event on the form instead of calling submit() on it?

`requestSubmit()`*

https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormEle...

Re: Brut: A New Web Framework for Ruby

#44

I like the emphasis on forms and pages. That's the approach I take in my apps. Forms and Links drive all interaction. Any JavaScript enhancements merely click an existing form (even if it's hidden). You can always inspect the HTML and know exactly the route that will handle the interaction. I think controllers are overused. It's really forms, models (backend) and views (Pages). A lot of the validation and ceremony of…

Is there a reason you literally simulate a click event on the form instead of calling submit() on it?

Yeah, it's escaping me at the moment all of the reasons, but calling .submit() on a form element doesn't exactly have all of the behaviors as calling .click() on a button element in a form, particularly multiple buttons in a form.

Re: Brut: A New Web Framework for Ruby

#45

Earlier quoted context omitted.

Is there a reason you literally simulate a click event on the form instead of calling submit() on it?

Yeah, it's escaping me at the moment all of the reasons, but calling .submit() on a form element doesn't exactly have all of the behaviors as calling .click() on a button element in a form, particularly multiple buttons in a form.

Are you perhaps using the button name/value for something? Havent tested but i suspect that submit() does not pass that right?

Re: Brut: A New Web Framework for Ruby

#46

[flagged]

In an era of constant professional extinction threat, author took risk and motivation to build an entire framework for free. And there is you attacking their ego.

AI is coming for us all, I’m not attacking, I’m simply stating the hubris in the statements pulled directly from their website.

Re: Brut: A New Web Framework for Ruby

#47

Earlier quoted context omitted.

One can learn a lot from the Adapter pattern. Don’t force me into your box, provide a framework for me to solve my problems.

You should give some humility lessons...

Here’s one. “I wrote a web framework that bundles all my favorite tools and dependencies, maybe you’ll also like it” would be a great start.

Re: Brut: A New Web Framework for Ruby

#48

Earlier quoted context omitted.

Yeah, it's escaping me at the moment all of the reasons, but calling .submit() on a form element doesn't exactly have all of the behaviors as calling .click() on a button element in a form, particularly multiple buttons in a form.

Are you perhaps using the button name/value for something? Havent tested but i suspect that submit() does not pass that right?

Yep that's one reason. I make heavy use of that.

Re: Brut: A New Web Framework for Ruby

#49
post #42

I see it is currently based on Sinatra. Just wondering if you have considered looking into Roda?

(author here) It only uses Sinatra because I happened to know it and needed to bootstrap the low-level stuff. I don't know if it needs to be based on Sinatra in the long term - it should probably just use Rack.

Re: Brut: A New Web Framework for Ruby

#50
post #40

Neat, this looks like it might be a good middle ground between Sinatra (which I adore) on the barebones/low-level end and Rails (which I also adore for apps that need it, but simple apps really don't). Looking forward to trying it out!

Another option is https://roda.jeremyevans.net/ , which I've found is the sweet spot in smaller projects, but can still scale up. The plugin system works really well to extend and the routing tree is really easy to work with.

Roda is hands-down my favorite framework and my go-to no matter the size of the app. It's super lightweight, crazy fast, and a great alternative to Rails, without all the extra bloat. You still get everything you need to build solid apps, just in a much leaner package.

We recently moved a legacy Rails 2.3 app over to the latest Roda, and paired it with Vite, Stimulus, and Tailwind on the frontend...and honestly, we couldn't be happier with how it turned out!

Post reply on HN