As Sinatra can be used for applications that can be bare minimum or large and complex, the application structure can grow bigger with the need.
For now, let's stick to the basic layout.
A basic Sinatra application will have a ruby file that has all the controllers defined (for example,
If we want to have different HTML files (or different views), we should place all such files in the
The layout is as follows:
Naming convention: The main application file is generally named
Let's now see how to write views. Views can be written in HTML. However, there are some gems in Ruby that make our lives easier. One of them is HAML.