Sha256: 5743ac8c17007f7b27c0232c7e3be182cc08ca5d207bc651d1b77e760e3e3769
Contents?: true
Size: 658 Bytes
Versions: 1
Compression:
Stored size: 658 Bytes
Contents
# 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. # 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.
Version data entries
1 entries across 1 versions & 1 rubygems
Version | Path |
---|---|
sinatra-default-templates-1.0.0 | Readme.txt |