Created
June 29, 2011 15:38
-
-
Save datapimp/1054114 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
| App.util.parse_content_location = (location)-> | |
| # parts = ["content_packages","1","sections","1"] | |
| # parent class, parent id, content item class, content item id | |
| parts = location.split(':') | |
| App.util.find_object_for_location = (content_location)-> | |
| [pkg, pkg_id, store, object_id] = App.util.parse_content_location(content_location) | |
| # find the table based on the store variable | |
| collection = Store(store) | |
| # fetch the item from the table based on the object_id variable | |
| return collection.get object_id if collection? and object_id? |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment