Intro to Roda (a Ruby web framework) Episode 1

Roda is a routing tree web toolkit which, if you’ve read my post about Sinatra, seems to provide the same simplicity to write routes for a web application, with the added advantage of a tree structure to avoid repetitions (more on that later, if/when it applies to my project).

For now, I thought that a similar “Intro do Roda” post was in order, as this may be the framework that I use in the future, and learn more about, and complete more episodes about on this site.

Starting with Roda is as simple as requiring it and adding blocks with your routes. Here is the example from the website (very pretty and clear, compare to the docs for Sequel, also a gem by Jeremy Evans):

basic roda routes example

And here is my first route:

author's first roda route

You will notice two additions:

navbar and yield example

NINI home page with Roda

Now, same as with Sinatra in the previous post, it’s time to add more complex features… in Episode 2!