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

Mounted Rack apps should have default named routes based on app name #17944

Merged
merged 1 commit into from Dec 6, 2014

Conversation

tjschuck
Copy link
Contributor

@tjschuck tjschuck commented Dec 6, 2014

This fixes a regression in 4.2.0 from 4.1.8, introduced in 4a7b959.
#17823 fixed a similar regression regarding explicitly named routes for a mounted Rack app, but there was another regression for the default value.

With a route like:

Rails.application.routes.draw do
  mount Mountable::Web, at: 'some_route'
end

The "Prefix" column of rake routes gives the following:

- 4.1.8:         mountable_web
- 4.2.0.beta1-4: [nothing]
- 4.2.0.rc1:     [nothing]
- 4.2.0.rc2:     some_route   <- regression

This fixes the default to go back to being based off the name of the class like the docs specify

Explicitly named routes still work correctly per #17823:

Rails.application.routes.draw do
  mount Mountable::Web, at: 'some_route', as: 'named'
end
- 4.1.8:         named
- 4.2.0.beta1-4: [nothing]
- 4.2.0.rc1:     [nothing]
- 4.2.0.rc2:     named

/cc @rafaelfranca @tenderlove

This fixes a regression in 4.2.0 from 4.1.8.

rails#17823 fixed a similar regression regarding _explicitly_ named routes for a mounted Rack app, but there was another regression for the default value.

With a route like:

    Rails.application.routes.draw do
      mount Mountable::Web, at: 'some_route'
    end

The "Prefix" column of rake routes gives the following:

- 4.1.8:         mountable_web
- 4.2.0.beta1-4: [nothing]
- 4.2.0.rc1:     [nothing]
- 4.2.0.rc2:     some_route   <- regression

This fixes the default to go back to being based off the name of the class like the docs specify: https://github.com/rails/rails/blob/785d04e3109f69d0b9b9f4732179592f0ef04e52/actionpack/lib/action_dispatch/routing/mapper.rb#L558-L560

Explicitly named routes still work correctly per rails#17823:

    Rails.application.routes.draw do
      mount Mountable::Web, at: 'some_route', as: 'named'
    end

- 4.1.8:         named
- 4.2.0.beta1-4: [nothing]
- 4.2.0.rc1:     [nothing]
- 4.2.0.rc2:     named
spastorino added a commit that referenced this pull request Dec 6, 2014
Mounted Rack apps should have default named routes based on app name
@spastorino spastorino merged commit 01c3b92 into rails:master Dec 6, 2014
spastorino added a commit that referenced this pull request Dec 6, 2014
Mounted Rack apps should have default named routes based on app name
@rafaelfranca rafaelfranca added this to the 4.2.0 milestone Dec 8, 2014
@tjschuck tjschuck deleted the mounted_named_routes_regression branch January 5, 2017 17:01
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

3 participants