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

Don't hardcode assets route skipped in route inspector #4469

Merged

Conversation

guilleiguaran
Copy link
Member

Right now generating a resource named asset with scaffold and setting config.assets.prefix = '/sprockets' (to avoid conflicting with generated resources) the output of rake routes is:

/tmp/foo % rake routes
  /sprockets #<Sprockets::Environment:0x3fea8846578c root="/private/tmp/foo", paths=["/private/tmp/foo/app/assets/images", "/private/tmp/foo/app/assets/javascripts", "/private/tmp/foo/app/assets/stylesheets", "/private/tmp/foo/vendor/assets/javascripts", "/private/tmp/foo/vendor/assets/stylesheets", "/Users/guille/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/gems/jquery-rails-2.0.0/vendor/assets/javascripts", "/Users/guille/.rbenv/versions/1.9.3-p0/lib/ruby/gems/1.9.1/bundler/gems/coffee-rails-6b4034abbf7d/lib/assets/javascripts"], digest="aa7d0db7619379e13b08335dee027df2">

This have two issues, the first one is that any of the routes prefixed with /assets is shown and the second one is that the /sprockets one shouldn't be shown.

After of apply this patch, the output rake routes is the expected:

/tmp/foo % rake routes
    assets GET    /assets(.:format)          assets#index
           POST   /assets(.:format)          assets#create
 new_asset GET    /assets/new(.:format)      assets#new
edit_asset GET    /assets/:id/edit(.:format) assets#edit
     asset GET    /assets/:id(.:format)      assets#show
           PUT    /assets/:id(.:format)      assets#update
           DELETE /assets/:id(.:format)      assets#destroy

josevalim added a commit that referenced this pull request Jan 15, 2012
…ute-inspector

Don't hardcode assets route skipped in route inspector
@josevalim josevalim merged commit ff722f9 into rails:master Jan 15, 2012
@josevalim
Copy link
Contributor

For 3-2-stable as well pls?

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