Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Sample Spine.js Routing Controller in Pragmatic.ly
class App.TicketsController extends Spine.Controller
constructor: ->
super
@routes
"/tickets": @index
"/tickets/:id" : (params) ->
@show(params.id)
index: ->
tickets = App.Ticket.all()
App.Ticket.trigger "tickets:index", tickets
show: (id) ->
ticket = App.Ticket.find(id)
$.publish 'ticket:switch', ticket
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.