Skip to content

Instantly share code, notes, and snippets.

@vosechu
Created July 26, 2012 23:29
Show Gist options
  • Save vosechu/3185228 to your computer and use it in GitHub Desktop.
Save vosechu/3185228 to your computer and use it in GitHub Desktop.
collection: new HoursCollection
initialize: (id) ->
_.bindAll this
if id
@model = CE.RestaurantsCollection.get(id)
if !@model
@model = new Restaurant
@model.id = id if id
@model.bind("change", @render)
@model.fetch
success: ->
@sub_views = {}
@collection.on 'reset', @render
@collection = @model.hours
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment