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

Remove trailing "#" on rake routes for controller only routes #3337

Merged

Conversation

htanata
Copy link
Contributor

@htanata htanata commented Oct 15, 2011

When running rake routes for controller only route like:

match 'api/:action' => 'api'

we get:

  api/:action(.:format) api#

This patch removes the trailing #.

@htanata
Copy link
Contributor Author

htanata commented Oct 20, 2011

cc @josevalim

@josevalim
Copy link
Contributor

I think "api#:action" would be a better result. It is more clear. What do you think?

@htanata
Copy link
Contributor Author

htanata commented Oct 20, 2011

Yes, it looks clearer. But then shouldn't we also apply it for the others for consistency? For example:

match ':controller/:action'
=>  /:controller/:action(.:format) :controller#:action

match ':controller(/:action(/:id))', :id => /\d+/
=>  /:controller(/:action(/:id))(.:format) :controller#:action {:id=>/\d+/}

In other words, we put :controller and :action where it's empty.

@josevalim
Copy link
Contributor

Yes, please.

@htanata
Copy link
Contributor Author

htanata commented Oct 29, 2011

I've updated my patch.

@josevalim
Copy link
Contributor

Awesome, merged, thanks!

josevalim added a commit that referenced this pull request Oct 29, 2011
…only_route

Remove trailing "#" on rake routes for controller only routes
@josevalim josevalim merged commit e886f97 into rails:master Oct 29, 2011
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

2 participants