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 mount routes to top-level context #381

Merged
merged 1 commit into from
Jan 15, 2016
Merged

Conversation

seanpdoyle
Copy link
Contributor

Don't mount route helpers at top-level.

For instance, while serving an Ember application from /admin/editor,
the application could be mounted like this:

mount_ember_app :admin, to: "/admin/editor"

The previous implementation allows for this, as it was written with this
use case in mind.

Alternatively, the application could be mounted from within a
namespace, scope, or constraint block. Unfortunately, the previous
implementation doesn't support these use cases, since the routes are
mounted at the global level (i.e. in the first line of a
Rails.application.routes.draw block).

This commit adds support for the latter case, taking into account the
surrounding context with which the route helpers are invoked.

Don't mount route helpers at top-level.

For instance, while serving an Ember application from `/admin/editor`,
the application could be mounted like this:

```rb
mount_ember_app :admin, to: "/admin/editor"
```

The previous implementation allows for this, as it was written with this
use case in mind.

Alternatively, the application could be mounted from within a
`namespace`, `scope`, or `constraint` block. Unfortunately, the previous
implementation doesn't support these use cases, since the routes are
mounted at the global level (i.e. in the first line of a
 `Rails.application.routes.draw` block).

This commit adds support for the latter case, taking into account the
surrounding context with which the route helpers are invoked.
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.

1 participant