Created
February 1, 2011 22:38
-
-
Save robheittman/806874 to your computer and use it in GitHub Desktop.
Some navigation using the Posts API
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
def expand(parent) | |
parent.posts.each do |child| | |
link = "/collections#{@engine.getPathFor(child)}/rubyfragment.html" | |
$document.write <<-END | |
<div><a href='#{link}'>#{child['name']}<a></div> | |
#{child['description']} | |
<div style='padding-left: 20px'> | |
END | |
expand child | |
$document.write <<-END | |
</div> | |
END | |
end | |
end | |
@engine = $GoGoEgo.getPlugin('Posts') | |
expand @engine.current |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment