Skip to content

Instantly share code, notes, and snippets.

@juliocesar
Created June 30, 2012 02:55
Show Gist options
  • Save juliocesar/3021963 to your computer and use it in GitHub Desktop.
Save juliocesar/3021963 to your computer and use it in GitHub Desktop.
Sample Tres app
$ ->
HomeScreen = Tres.Screen.extend()
App = new Tres.App
App.on
'' : new HomeScreen
App.boot()
@juliocesar
Copy link
Author

Trying to keep the "code required for basic apps" at a minimum. This is currently the bare minimum necessary for creating a Tres app.

@gabehollombe
Copy link

The empty string for the first key in App.on seems odd. Would you normally have something more descriptive there?

@juliocesar
Copy link
Author

That's the root URL, as you probably figured. Backbone will let you get away with using "/", which is more obvious, I think.

@gabehollombe
Copy link

gabehollombe commented Jul 4, 2012 via email

@juliocesar
Copy link
Author

Except it doesn't. And yes, it's sad.

When I saw your comment yesterday I wasn't in front of my computer, so I couldn't test it, but I vaguely recalled something along the lines of routes not matching when you add a "/" in front of them. That's what actually happens if you do.

@gabehollombe
Copy link

gabehollombe commented Jul 5, 2012 via email

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment