Created
September 23, 2012 20:05
-
-
Save fanktom/3772889 to your computer and use it in GitHub Desktop.
Scales API Partials
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
@partial_html = "<div>Just the Navigation</div>" | |
@partial_xml = "<track><name>Islandary</name><artist>Thomas Fankhauser</artist></track>" | |
@partial_json = '{ name : "Islandary", artist : "Thomas Fankhauser" }' | |
# Push a HTML Partial | |
Scales.push :html => @partial_html, :to => "navigation" | |
# Push a XML Partial | |
Scales.push :xml => @partial_xml, :to => "islandary.xml" | |
# Push a JSON Partial | |
Scales.push :json => @partial_json, :to => "islandary.json" | |
# Use the HTML Partial | |
@html = ' | |
<html> | |
<head></head> | |
<body> | |
Scales.partial "navigation" | |
</body> | |
</html> | |
' | |
# Use the XML Partial | |
@xml = ' | |
<tracks> | |
Scales.partial "islandary.xml" | |
</tracks> | |
' | |
# Use the JSON Partial | |
@json = ' | |
[ | |
Scales.partial "islandary.json" | |
] | |
' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment