I want to be able to pass a specific route in my web app. Its a good size (and growing) sinatra app.
what I have
get '/' do
haml :Hello_World
end
what I want
get '/' do
haml :/specific/path/Hello_World
end
I realize I could change the root directory with
set :views, settings.root + '/my/path'
But this really isn’t a preferable option because I need multiple specific routes.
In order to have a symbol that contains forward slashes you need to surround it with quotes. So if you want to render a view in a directory just surround the path with quotes. So your example would become…