No commit activity in last 3 years
No release in over 3 years
Saves you from having to write routes just to render templates with the same name. Rails-style.
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

= 2.2.17
>= 0.5.3
>= 1.3.0

Runtime

>= 1.0.a
 Project Readme
# sinatra-default-templates

To avoid repetitive routes like

get '/foo' do
  haml :foo
end

get '/bar' do
  haml :bar
end

if you have the templates in place (views/foo.haml, views/bar.haml in the above case), they'll get
rendered automagically.

# Installation

Make sure you got http://gemcutter.org in your gem sources. Then simply

$ sudo gem install sinatra-default-templates

# How to use

Because of a bug in Sinatra 0.9.4, extensions cannot set routes, or for that matter, define
not_found or error blocks. And since I decided to turn this into one, you'll have to use 
Sinatra 1.0.a (or above). In which case, simply:

require 'sinatra'
require 'sinatra/default_templates'

And you're set.

# Specs

Just run

$ spec spec/default_templates_spec.rb

Presumes rspec 1.3.0 is installed.