SlashForce
SlashForce
is a simple gem for Ruby on Rails
to append trailing slash to paths.
example
-
http://example.com
is redirected tohttp://example.com/
-
http://example.com/test?foo=1
is redirected tohttp://example.com/test/?foo=1
Installation
Add this line to your application's Gemfile:
gem 'slash_force'
Usage
- include
SlashForce
module. - define
before_action :append_trailing_slash
callback.
class ApplicationController
include SlashForce
before_action :append_trailing_slash, only: [:show]
...
Contributing
Bug reports and pull requests are welcome on GitHub at https://github.com/shotat/slash-force. This project is intended to be a safe, welcoming space for collaboration, and contributors are expected to adhere to the Contributor Covenant code of conduct.
License
The gem is available as open source under the terms of the MIT License.