Skip to content

Instantly share code, notes, and snippets.

@inossidabile
Created May 31, 2012 13:44
Show Gist options
  • Select an option

  • Save inossidabile/2843507 to your computer and use it in GitHub Desktop.

Select an option

Save inossidabile/2843507 to your computer and use it in GitHub Desktop.
Joosy.namespace 'Posts', ->
# Page that lists posts
class @IndexPage extends ApplicationPage
# Deterimes which Layout to wrap this page in
@layout ApplicationLayout
# Determines which template to use
@view 'index'
# Data fetching hook
@fetch (complete) ->
Post.find 'all', (posts) =>
# Passes collection to the template
@data.posts = posts
complete()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment