Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add headings to rake routes table #9318

Merged
merged 1 commit into from Feb 19, 2013
Merged

Conversation

steveklabnik
Copy link
Member

Another "get some feedback on this idea" PR. Thanks @burtlo!

It's easy to forget what the order of things are in the routing table, especially if you're new. The HTML view has headings, but the console does not. They're a little different at the moment due to space, but I can change them to be as close to possible once we determine this is a good idea.

$ rake routes
  Prefix Verb   URI Pattern              Controller#Action
    foos GET    /foos(.:format)          foos#index
         POST   /foos(.:format)          foos#create
 new_foo GET    /foos/new(.:format)      foos#new
edit_foo GET    /foos/:id/edit(.:format) foos#edit
     foo GET    /foos/:id(.:format)      foos#show
         PATCH  /foos/:id(.:format)      foos#update
         PUT    /foos/:id(.:format)      foos#update
         DELETE /foos/:id(.:format)      foos#destroy

One other thing I'd like to implement, but haven't: test if we're running in a shell or not. If we're not, then we shouldn't print the headings. If you're writing scripts that rely on the output of the task, no headings is way better.

@achempion
Copy link
Contributor

I think that it unnecessary info. If you type rake routes – you must know what command do

@ninkibah
Copy link

Generally I know exactly what my URL will be, so I'd love if you could sort the URI Pattern alphabetically. Especially in the HTML view.

@burtlo
Copy link

burtlo commented Feb 18, 2013

@achempion as I am often teaching people rails for the first time individuals learning the command are only helped by the presence of the column headers.

fxn added a commit that referenced this pull request Feb 19, 2013
@fxn fxn merged commit 8fd17e0 into rails:master Feb 19, 2013
@steveklabnik
Copy link
Member Author

🎊

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants