mirror of
https://github.com/jbranchaud/til
synced 2026-01-03 15:18:01 +00:00
Add Show Rails Routes With Pry as a rails til.
This commit is contained in:
@@ -189,6 +189,7 @@ smart people at [Hashrocket](http://hashrocket.com/).
|
||||
- [Select Value For SQL Counts](rails/select-value-for-sql-counts.md)
|
||||
- [Show Pending Migrations](rails/show-pending-migrations.md)
|
||||
- [Show Rails Models With Pry](rails/show-rails-models-with-pry.md)
|
||||
- [Show Rails Routes With Pry](rails/show-rails-routes-with-pry.md)
|
||||
|
||||
### ruby
|
||||
|
||||
|
||||
30
rails/show-rails-routes-with-pry.md
Normal file
30
rails/show-rails-routes-with-pry.md
Normal file
@@ -0,0 +1,30 @@
|
||||
# Show Rails Routes With Pry
|
||||
|
||||
In [Show Rails Models With Pry](show-rails-models-with-pry), I showed that
|
||||
[`pry-rails`](https://github.com/rweng/pry-rails) comes with some handy
|
||||
console commands. In addition to being able to list all your Rails models,
|
||||
you can list all the routes for your application using `show-routes`.
|
||||
|
||||
I get the following output by using that command in a small blog project:
|
||||
|
||||
```
|
||||
> show-routes
|
||||
Prefix Verb URI Pattern Controller#Action
|
||||
root GET / application#index
|
||||
markdownify_articles POST /articles/markdownify(.:format) articles#markdownify
|
||||
articles POST /articles(.:format) articles#create
|
||||
new_article GET /articles/new(.:format) articles#new
|
||||
edit_article GET /articles/:id/edit(.:format) articles#edit
|
||||
article GET /articles/:id(.:format) articles#show
|
||||
PATCH /articles/:id(.:format) articles#update
|
||||
PUT /articles/:id(.:format) articles#update
|
||||
users POST /users(.:format) users#create
|
||||
new_user GET /users/new(.:format) users#new
|
||||
user GET /users/:id(.:format) users#show
|
||||
sessions POST /sessions(.:format) sessions#create
|
||||
new_session GET /sessions/new(.:format) sessions#new
|
||||
session DELETE /sessions/:id(.:format) sessions#destroy
|
||||
signin GET /signin(.:format) sessions#new
|
||||
POST /signin(.:format) sessions#create
|
||||
signup GET /signup(.:format) users#new
|
||||
```
|
||||
Reference in New Issue
Block a user