7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
|
# File 'lib/ember_cli/route_helpers.rb', line 7
def mount_ember_app(app_name, to:, **options)
routing_options = options.deep_merge(
defaults: { ember_app: app_name },
)
routing_options.reverse_merge!(
controller: "ember_cli/ember",
action: "index",
format: :html,
)
scope constraints: ::EmberCli::EmberConstraint.new do
redirect_if_missing_trailing_slash = {
constraints: EmberCli::TrailingSlashConstraint.new,
to: redirect(-> (_, request) {
File.join(request.original_fullpath, "")
}),
}
get(to, redirect_if_missing_trailing_slash)
get(File.join(to, "(*rest)"), routing_options)
end
mount_ember_assets(app_name, to: to)
end
|