Created
March 15, 2012 09:12
-
-
Save dougo-chris/2043113 to your computer and use it in GitHub Desktop.
Extending my Existing project to handle a small sub app
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
## remember to add this file to application.rb | |
## config.assets.precompile << 'site.js' | |
#= require_self | |
#= require_tree ./site/template | |
#= require_tree ./site/view | |
window.Site = | |
Model: {} | |
Collection: {} | |
View: {} | |
Partial: {} | |
$.extend Gpm.Router.prototype.routes, | |
"site/home": "siteHome" | |
"BX_ACCESS_DENIED": "siteHome" | |
"site/todo/:name": "siteTodo" | |
"site/todo": "siteTodo" | |
"site/:template": "siteTemplate" | |
$.extend Gpm.Router.prototype, | |
siteHome: -> | |
@setBody(Site.View.Home) | |
siteTodo: (name)-> | |
@setBody(Site.View.Todo, {name: name}) | |
siteTemplate: (template) -> | |
@setBody(Site.View.Template, {template: template}) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment