This commit is contained in:
Tony Tam
2012-11-27 15:04:12 -08:00
parent 3fd37c3ef6
commit 7bc8109e88
2 changed files with 19 additions and 10 deletions

View File

@@ -4,11 +4,18 @@ class ResourceView extends Backbone.View
render: ->
$(@el).html(Handlebars.templates.resource(@model))
@number = 0
# Render each operation
@addOperation operation for operation in @model.operationsArray
@
addOperation: (operation) ->
operation.number = @number
# Render an operation and add it to operations li
operationView = new OperationView({model: operation, tagName: 'li', className: 'endpoint'})
$('.endpoints', $(@el)).append operationView.render().el
@number++