I have an app that, for server configuration purposes that cannot be changed, has to reside in http://localhost/csp/acb/citas/. Therefore, I created the following app.
App.Router.map(function() {
this.route("index", { path: "" });
this.route("main", {path: "main"});
});
App.Router.reopen({
rootURL: '/csp/acb/citas/'
});
var items = [
{item: "Main", url:"main" },
{item: "Work", url: "work" },
{item: "Conf", url: "conf" }
];
App.ApplicationController = Ember.Controller.extend({
items: items
});
And the following template (by the way, this is a component).
<script type="text/x-handlebars" id="components/bs-header">
<div class="navbar-header">
<button type="button" class="navbar-toggle" data-toggle="collapse" data-target=".navbar-collapse">
<span class="sr-only">Toggle navigation</span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
<span class="icon-bar"></span>
</button>
<a class="navbar-brand" href="#">Bootstrap theme</a>
</div>
<div class="navbar-collapse collapse">
<ul class="nav navbar-nav">
{{#each items}}
{{log item}}
<li>{{#link-to url item}}{{item}}{{/link-to}}</li>
{{/each}}
</ul>
</div><!--/.nav-collapse -->
</script>
When I run the app, i get the following error.
Uncaught Error: More context objects were passed than there are dynamic segments for the route: main
When I include the /csp/acb/citas/ to the route and url of the template, i get the following.
Uncaught Error: Assertion Failed: The attempt to link-to route ‘/csp/acb/citas/main’ failed (also tried ‘/csp/acb/citas/main.index’). The router did not find ‘/csp/acb/citas/main’ in its possible routes: ‘loading’, ‘error’, ‘index’, ‘main’
This is really frustating since I thought this would be a simple task to perform. Please help.