Glimmer DSL for Web (Fukuoka Award Winning Ruby-in-the-Browser Frontend Framework for Rails) had a new release in version 0.8.2, which now supports HTML Value-less Boolean Attributes, simplifying the Ruby HTML DSL when using HTML boolean attributes like 'required', 'autofocus', and 'disabled'. There is no need to pass them in a hash with value true anymore. They could now be just passed as Ruby Symbols in HTML element arguments, ahead of hash attributes.
For example, instead of writing this:
input(type: 'text', id: 'name-field', required: true, autofocus: true)
You can now write this instead:
input(:required, :autofocus, type: 'text', id: 'name-field')
That would generate the following HTML upon rendering a Glimmer component:
<input type="text" id="name-field" required autofocus>
Happy Glimmering!
P.S. Glimmer DSL for Web will be presented at the following conferences in 2026:
- APRIL 17, 2026 3-hour Workshop: "Building Rails SPAs in Frontend Ruby with Glimmer DSL for Web" at the wroclove.rb 2026 Ruby Conference, in Wroclaw, Poland
- MAY 30, 2026 Talk: "Frontend Ruby on Rails with Glimmer DSL for Web" at RubyConf Austria 2026, in Vienna, Austria
No comments:
Post a Comment