This sounds great to me, i will surely try. Thank you
On Sat, Feb 3, 2018 at 5:38 PM, Ivo Herweijer <firstname.lastname@example.org> wrote:
Yes, I know this is a Ruby mailing list and this post is about
webdevelopment. But I promise there is a happy Ruby ending to this story.
As webdevelopers we have become accustomed to writing HTML and CSS. And
for webapplications that are rich in front-end logic we add lots of
style of building webapplications is the fact that a lot of steps are
involved to add interactivity. We define elements in html and give these
elements an id, look up this id from within javascipt and add an event to
the element that points to some code that finally does what we want it to
One might think that we *have* to use html since this is what webbrowsers
use internally. But that is not quite true, a webbrowser uses the Document
Object Model (DOM) internally which is a memory structure. Using html is
one way of specifying what that memory structure should look like. Another
shadow DOM where changes in html are written to. The shadow DOM is kept in
sync with the webbrowsers DOM.
I have been tinkering with the idea to take this last approach a step
further. To skip html altogether and only define the desired structure of
an application in code. So let's use Ruby for this and let's call this
structure of the application the Ruby Object Model (ROM). Add the needed
components of the webapplication to the ROM, a header, an article, a menu,
etcetera. And add logic to ROM objects, so when for instance a button is
clicked some code is executed belonging to that object. Immediate advantage
of this approach is that, apart from specifying CSS rules, we can focus all
our attention on one piece of Ruby code.
Now to prove that I'm not just some evil mad scientist and this idea could
actually work I have created a gem called Ferro . It can translate the
ROM state to the webbrowsers DOM state. It relies on Opal  to run in the
There is also a website  to demonstrate and explain Ferro's abilities.
If you would visit this website and type ctrl+U, you would see there is
hardly any html source code present. As you can see in the source code 
Love to hear what you think about Ferro.