Skip to content

Instantly share code, notes, and snippets.

@avgerin0s
Created February 8, 2013 17:05
Show Gist options
  • Save avgerin0s/4740398 to your computer and use it in GitHub Desktop.
Save avgerin0s/4740398 to your computer and use it in GitHub Desktop.
class Raffler.Routers.Entries extends Backbone.Router
routes:
'': 'index'
'entries/:id': 'show'
initialize: ->
@collection = new Raffler.Collections.Entries()
@collection.fetch()
index: ->
view = new Raffler.Views.EntriesIndex(collection: @collection)
$('#container').html(view.render().el)
show: (id) ->
alert "Entry #{id}"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment