Ruby Sinatra Helper

helpers do
  def bar(name)
    "#{name}bar"
  end
end

get '/:name' do
  bar(params[:name])
end
Vast Vicuña