Skip to content

msroz/better_routes

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

4 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸ–Œ 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.

About

πŸ–Œ Print rials routes with various formats such as TSV, CSV and Markdown.

Resources

License

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages