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
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,10 @@ master
------

* Fix bug with generated `bin/heroku_install` script iterating through multiple
Ember application's directories.
* Don't mount route helpers at top-level. Instead, mount within the surrounding
context with which they're invoked. [#381]

[#381]: https://github.com/thoughtbot/ember-cli-rails/pull/381

0.7.0
-----
Expand Down
12 changes: 5 additions & 7 deletions lib/ember_cli/route_helpers.rb
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,13 @@ def mount_ember_app(app_name, to:, **options)
format: :html,
)

Rails.application.routes.draw do
scope constraints: EmberCli::HtmlConstraint.new do
get("#{to}(*rest)", routing_options)
end
scope constraints: ::EmberCli::HtmlConstraint.new do
get("#{to}(*rest)", routing_options)
end

dist_directory = EmberCli[app_name].paths.dist
dist_directory = ::EmberCli[app_name].paths.dist

mount Rack::File.new(dist_directory.to_s) => to
end
mount Rack::File.new(dist_directory.to_s) => to
end
end
end
Expand Down