Created
August 4, 2012 12:54
-
-
Save yaoquan/3257530 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| Joosy.namespace 'CompetencyUnits', -> | |
| class @IndexPage extends ApplicationPage | |
| @layout ApplicationLayout | |
| @view 'index' | |
| @fetch (complete) -> | |
| CompetencyUnit.find 'all', (competency_units) => | |
| @data.competency_units = competency_units | |
| @data.selectedCu = @data.competency_units.data[0] | |
| complete() | |
| editCu: (id) -> | |
| CompetencyUnit.find id, (selectedCu) => | |
| Joosy.Application.page.data.selectedCu.load selectedCu | |
| Joosy.Router.map | |
| 404 : (path) -> alert "Page '#{path}' was not found" | |
| '/' : -> @navigate '/competency_units' | |
| '/competency_units' : | |
| '/' : CompetencyUnits.IndexPage | |
| '/:id' : (params) -> Joosy.Application.page.editCu params.id |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment