0.0
No release in over 3 years
Low commit activity in last 3 years
Print rails routes with formats for development;)
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Runtime

>= 5.0.0
>= 5.0.0
 Project Readme

🖌 BetterRoutes

Print routes on Ruby on Rails with various formats.
It is easy way to copy and paste on Spreadsheet, GitHub and so on :)

🤲 Usage

$ rake better_routes

📐 Formats

Sample routes file

# config/routes.rb
Rails.application.routes.draw do
  resources :entries
end

TSV (Tab Separated Values)

# (default)
$ FORMAT=tsv rake better_routes

Prefix, Verb, URI Pattern, Controller#Action
entries GET     /entries(.:format)      entries#index
        POST    /entries(.:format)      entries#create
new_entry       GET     /entries/new(.:format)  entries#new
edit_entry      GET     /entries/:id/edit(.:format)     entries#edit
entry   GET     /entries/:id(.:format)  entries#show
        PATCH   /entries/:id(.:format)  entries#update
        PUT     /entries/:id(.:format)  entries#update
        DELETE  /entries/:id(.:format)  entries#destroy

CSV (Comma Separated Values)

$ FORMAT=csv rake better_routes
Prefix, Verb, URI Pattern, Controller#Action
entries,GET,/entries(.:format),entries#index
,POST,/entries(.:format),entries#create
new_entry,GET,/entries/new(.:format),entries#new
edit_entry,GET,/entries/:id/edit(.:format),entries#edit
entry,GET,/entries/:id(.:format),entries#show
,PATCH,/entries/:id(.:format),entries#update
,PUT,/entries/:id(.:format),entries#update
,DELETE,/entries/:id(.:format),entries#destroy

Markdown Table

$ FORMAT=markdown rake better_routes
|Prefix|Verb|URI Pattern|Controller#Action|
|------|----|-----------|-----------------|
|entries|GET|/entries(.:format)|entries#index|
||POST|/entries(.:format)|entries#create|
|new_entry|GET|/entries/new(.:format)|entries#new|
|edit_entry|GET|/entries/:id/edit(.:format)|entries#edit|
|entry|GET|/entries/:id(.:format)|entries#show|
||PATCH|/entries/:id(.:format)|entries#update|
||PUT|/entries/:id(.:format)|entries#update|
||DELETE|/entries/:id(.:format)|entries#destroy|

🤝 Installation

Add this line to your application's Gemfile:

gem 'better_routes'

And then execute:

$ bundle

Or install it yourself as:

$ gem install better_routes

👍 Contributing

Contribution directions go here.

👉 License

The gem is available as open source under the terms of the MIT License.