Skip to content

Commit

Permalink
Add events show
Browse files Browse the repository at this point in the history
  • Loading branch information
jefffederman committed Nov 10, 2014
1 parent 1f5c4b5 commit 625b668
Show file tree
Hide file tree
Showing 6 changed files with 44 additions and 8 deletions.
4 changes: 3 additions & 1 deletion app/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@ var Router = Ember.Router.extend({
});

Router.map(function() {
this.route('events');
this.route('events', function() {
this.route('show', { path: '/:id' });
});
});

export default Router;
7 changes: 7 additions & 0 deletions app/routes/events/show.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
import Ember from 'ember';

export default Ember.Route.extend({
model: function(params) {
return this.store.find('event', params.id);
}
});
2 changes: 1 addition & 1 deletion app/styles/app.scss
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,6 @@ body, html {
float: left;
}

.events {
ul {
list-style: none;
}
19 changes: 13 additions & 6 deletions app/templates/events.hbs
Original file line number Diff line number Diff line change
@@ -1,6 +1,13 @@
<ul class="events">
{{#each event in model}}
<li>{{event.description}}</li>
{{/each}}
</ul>
{{outlet}}
<div class="row">
<div class="column">
<ul>
{{#each event in model}}
<li>{{#link-to 'events.show' event}}{{event.description}}{{/link-to}}</li>
{{/each}}
</ul>
</div>
<div class="column">
{{outlet}}
</div>
</div>

6 changes: 6 additions & 0 deletions app/templates/events/show.hbs
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
<ul>
{{#each request in model.requests}}
<li>{{request.requestUrl}}</li>
{{/each}}
</ul>
{{outlet}}
14 changes: 14 additions & 0 deletions tests/unit/routes/events/show-test.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
import {
moduleFor,
test
} from 'ember-qunit';

moduleFor('route:events/show', 'EventsShowRoute', {
// Specify the other units that are required for this test.
// needs: ['controller:foo']
});

test('it exists', function() {
var route = this.subject();
ok(route);
});

0 comments on commit 625b668

Please sign in to comment.