Reputation: 13611
Trying to do some relatively basic client side setup with EmberJS with a small rails app. I have two things so far:
The first one loads fine. When i click the link in the application template, the form loads as expected.
The second however does not. The subject error pops up when i click the link to view the search page. Here's the code i have so far:
<script type="text/x-handlebars">
<div class="nav">
{{#linkTo "index_search"}}Home{{/linkTo}}
{{#linkTo sale_records.new}}Post a book for sale{{/linkTo}}
</div>
<div class="container">
{{outlet}}
</div>
</script>
Javascript:
// router.js
(function() {
LocalBookFinder.Router.map(function() {
this.resource("sale_records", { path: "/sale_records" }, function() {
this.route('new');
});
this.route("index_search", { path: "/search" });
});
LocalBookFinder.NewSalesRecordRoute = Ember.Route.extend({
model: function() {
return new LocalBookFinder.SaleRecord();
},
setupController: function(controller, model) {
}
});
LocalBookFinder.IndexSearchRoute = Ember.Route.extend({
setupController: function(controller, model) {
}
});
}).call(this);
// controllers/search/index_search_controller.js
(function() {
LocalBookFinder.IndexSearchController = Ember.ObjectController.extend({
});
}).call(this);
// views/search/index_search_view.js
(function() {
LocalBookFinder.IndexSearchView = Ember.View.create({
templateName: "search/index"
});
}).call(this);
The link itself renders fine. But once i click it, i get the error message, and nothing renders. Any ideas?
Upvotes: 2
Views: 2469
Reputation: 56
There is an error where you set up IndexSearchView. It should be Ember.View.extend, not Ember.View.create.
Upvotes: 3