rack-slashenforce
A rack middleware to enforce appending or removing trailing slashes from URLs.
Setup
$ gem install rack-slashenforce
Bundler users
If you use Bundler, you will need to add it to your Gemfile.
gem 'rack-slashenforce', :require => 'rack'
Usage
Add one of the following lines to config.ru:
To enforce a trailing slash on all urls without a period in them:
use Rack::AppendTrailingSlash
To enforce no trailing slashes on any urls:
use Rack::RemoveTrailingSlashes
For a more robust solution, see rack-rewrite.
Copyright (c) 2012 Tyler Kellen. See LICENSE for further details.