Sinatra is a micro web framework for Ruby. It uses Rack, supports RESTful routing, and allows defining URL patterns. Haml can be used as a templating language with Sinatra to generate HTML. Sass can also be used for CSS preprocessing. The presentation provided examples of defining routes and rendering templates in Sinatra using ERB and Haml.
11. URL PADRONIZADA
require 'rubygems'
require 'sinatra'
require 'haml'
post '/posts' do
post = Post.create! params
redirect “/posts/#{post.id}”
end
get '/posts/:id' do
@post = Post.find(params[:id])
haml :post
end