https://github.com/artofcode-/sensible_routes
Simple and comprehensible route introspection library for Rails.
https://github.com/artofcode-/sensible_routes
Last synced: about 1 month ago
JSON representation
Simple and comprehensible route introspection library for Rails.
- Host: GitHub
- URL: https://github.com/artofcode-/sensible_routes
- Owner: ArtOfCode-
- License: mit
- Created: 2018-06-28T23:27:24.000Z (almost 7 years ago)
- Default Branch: master
- Last Pushed: 2023-03-08T19:51:05.000Z (about 2 years ago)
- Last Synced: 2025-03-14T04:48:05.845Z (2 months ago)
- Language: Ruby
- Size: 60.5 KB
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 10
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# `sensible_routes`
Simple and comprehensible route introspection library for Rails.## Huh?
In a stock Rails app, `rake routes` is essentially the only way to get any introspection of routes. There's no programmatic access to them in detail,
beyond basic route helpers. This gem aims to make detailed programmatic introspection possible.## Installation
Add the following line to your Gemfile and run `bundle install`:gem 'sensible_routes'
Then, create a new initializer (say `config/initializers/sensible_routes.rb`), with this as its only content:SensibleRoute.hook_rails
## Usage
At a basic level, you can get a list of your application's routes in a useful form with this:Rails.sensible_routes
That returns a SensibleRouteCollection, which is array-like in that it responds to many of the same methods. You can also filter the collection down
further - see the [documentation](https://github.com/ArtOfCode-/sensible_routes/wiki) for full details.## Contributions
Welcome. Ping me a PR. For large changes you should probably open an issue first to discuss.## License
Available under the terms of the MIT license.