Permalink
Browse files

Added the cars index.

  • Loading branch information...
chrishalebarnes committed Feb 17, 2015
1 parent 69ffd47 commit dd4ca56fe8feb6a18181e576fed0cb65b98a6d6e
@@ -0,0 +1,6 @@
Cars.Car = DS.Model.extend({
make: DS.attr('string'),
model: DS.attr('string'),
color: DS.attr('string'),
condition: DS.attr('string')
});
@@ -1,5 +1,6 @@
// For more information see: http://emberjs.com/guides/routing/
Cars.Router.map(function() {
// this.resource('posts');
this.resource('cars', function() {
});
});
@@ -0,0 +1,5 @@
Cars.CarsIndexRoute = Ember.Route.extend({
model: function() {
return this.store.findAll('car');
}
});
@@ -0,0 +1,23 @@
<div id="cars-index" class="panel">
<h1>Cars</h1>
<table role="grid">
<thead>
<tr>
<th>Make</th>
<th>Model</th>
<th>Color</th>
<th>Condition</th>
</tr>
</thead>
<tbody>
{{# each car in model}}
<tr>
<td>{{car.make}}</td>
<td>{{car.model}}</td>
<td>{{car.color}}</td>
<td>{{car.condition}}</td>
</tr>
{{/each}}
</tbody>
</table>
</div>
View
@@ -4,6 +4,8 @@
root :to => 'assets#index'
get 'assets/index'
resources :cars
# The priority is based upon order of creation: first created -> highest priority.
# See how all your routes lay out with "rake routes".

0 comments on commit dd4ca56

Please sign in to comment.