Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Updates for ember-1.0.0-rc4 and ember-data 0.13.

  • Loading branch information...
commit 0e02f9d2d0355d252d6f0b58550b0dc6fa454e52 1 parent d6a0d7c
@michaeldupuisjr michaeldupuisjr authored
View
21 app/assets/javascripts/routes.js.coffee
@@ -6,9 +6,9 @@ App.Router.map ->
@resource 'users', ->
@route 'new'
@route 'edit',
- path: ':user_id/edit'
+ path: '/:user_id/edit'
@route 'show',
- path: ':user_id'
+ path: '/:user_id'
App.IndexRoute = Ember.Route.extend
setupController: (controller, model) ->
@@ -20,21 +20,18 @@ App.UsersRoute = Ember.Route.extend
setupController: (controller, model) ->
@controllerFor('application').set('currentRoute', 'users')
-App.EditUsersRoute = Ember.Route.extend
- model: (params)->
- App.User.find(params.user_id)
- setupController: (controller, model) ->
- controller.set('content', model)
- @controllerFor('application').set('currentRoute', 'users')
-
App.UsersNewRoute = App.UsersRoute.extend
model: ->
App.User.createRecord()
setupController: (controller, model) ->
controller.set('content', model)
-
-App.UsersShowRoute = Ember.Route.extend
+
+App.UserRoute = Ember.Route.extend
model: (params) ->
App.User.find(params.user_id)
setupController: (controller, model) ->
- controller.set('content', model)
+ controller.set('content', model)
+ @controllerFor('application').set('currentRoute', 'users')
+
+App.UsersShowRoute = App.UserRoute.extend()
+App.UsersEditRoute = App.UserRoute.extend()
View
3  app/assets/javascripts/store.js.coffee
@@ -1,2 +1 @@
-App.Store = DS.Store.extend
- revision: 12
+App.Store = DS.Store.extend()
View
5 app/assets/javascripts/templates/application.hbs
@@ -4,7 +4,7 @@
<div class='nav-collapse collapse'>
<ul class='nav'>
<li {{bindAttr class="isHome:active"}}>{{#linkTo 'index'}}Home{{/linkTo}}</li>
- <li {{bindAttr class="isUsers:active"}}>{{#linkTo 'users.index'}}Users{{/linkTo}}</li>
+ <li {{bindAttr class="isUsers:active"}}>{{#linkTo 'users'}}Users{{/linkTo}}</li>
</ul>
</div>
</div>
@@ -15,7 +15,8 @@
<div class='row'>
<div class='span12'>
<div class='page-header'></div>
- {{outlet}}
+ {{outlet}}
+ </div>
</div>
</div>
</div>
View
24 app/assets/javascripts/templates/users.hbs
@@ -1,17 +1,19 @@
<h1>Users</h1>
-<div class="span4">
+<div class="span3">
<table class='table table-striped'>
- {{#each controller}}
- <tr>
- <td>{{id}}</td>
- <td>{{#linkTo "users.show" this}}{{fullName}}{{/linkTo}}</td>
- </tr>
- {{/each}}
+ <tr>
+ <th>ID</th>
+ <th>Name</th>
+ </tr>
+ {{#each controller}}
+ <tr>
+ <td>{{id}}</td>
+ <td>{{#linkTo "users.show" this}}{{fullName}}{{/linkTo}}</td>
+ </tr>
+ {{/each}}
</table>
-
- {{#linkTo 'users.new' class='btn btn-primary'}}Create{{/linkTo}}
</div>
-<div class="span6">
+<div class="span8">
{{outlet}}
-</div>
+</div>
Please sign in to comment.
Something went wrong with that request. Please try again.