diff --git a/app/assets/javascripts/people.js.coffee b/app/assets/javascripts/people.js.coffee index 2ca6fa9..b55a713 100644 --- a/app/assets/javascripts/people.js.coffee +++ b/app/assets/javascripts/people.js.coffee @@ -15,9 +15,11 @@ class PersonCollection extends Backbone.Collection $ -> collection = new PersonCollection - collection.fetch() - html = ich.people(collection) - $("body").append(html) + collection.fetch({ + success: -> + html = ich.people(collection) + $("body").append(html) + }) diff --git a/app/views/people/index.html.haml b/app/views/people/index.html.haml index 0016c83..df9c711 100644 --- a/app/views/people/index.html.haml +++ b/app/views/people/index.html.haml @@ -3,18 +3,16 @@ %p.name {{ name }} +%script#person_index.partial{:type => "text/html"} + %li + %p.name + {{name}} + %script#people{:type => "text/html"} %ul {{#models}} - {{ name }} + {{#attributes}} + {{> person_index}} + {{/attributes}} {{/models}} - -%script#person_index{:type => "text/html"} - %li - %p.name - {{ name }} - - -/.my_id -