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…
Brut: A New Web Framework for Ruby
41–50 of 88 posts
Re: Brut: A New Web Framework for Ruby
#42Re: Brut: A New Web Framework for Ruby
#43I 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?
https://developer.mozilla.org/en-US/docs/Web/API/HTMLFormEle...
Re: Brut: A New Web Framework for Ruby
#44I 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
#45Earlier 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.
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.
Re: Brut: A New Web Framework for Ruby
#47Earlier 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...
Re: Brut: A New Web Framework for Ruby
#48Earlier 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?
Re: Brut: A New Web Framework for Ruby
#49I see it is currently based on Sinatra. Just wondering if you have considered looking into Roda?
Re: Brut: A New Web Framework for Ruby
#50Neat, 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.
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!