Skip to content

Instantly share code, notes, and snippets.

Created January 16, 2013 10:42
Show Gist options
  • Save anonymous/4546270 to your computer and use it in GitHub Desktop.
Save anonymous/4546270 to your computer and use it in GitHub Desktop.
module.exports = class ReportController extends Controller
historyURL: 'reports'
index: ->
collection = new Reports()
collection.fetch()
@view = new ReportListView
collection: collection
class ReportListItemView extends View
tagName: 'tr'
template: require 'views/templates/report_list_item'
events:
'click .remove': 'remove'
remove: (event) =>
@model.destroy()
module.exports.ReportListView = class ReportListView extends CollectionView
container: '#page-container'
autoRender: yes
template: require 'views/templates/report_list'
className: 'report-list'
listSelector: '#list'
itemView: ReportListItemView
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment