Skip to content

Instantly share code, notes, and snippets.

@dominiek
Created June 5, 2009 07:01
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dominiek/124116 to your computer and use it in GitHub Desktop.
Save dominiek/124116 to your computer and use it in GitHub Desktop.
# After get, show operations
def render_json_collection(collection)
hash = {:status => {:code => 200}}
hash[:result] = collection
render_json_with_callback(hash.to_json)
end
# After delete, create operations
def render_status(status)
hash = {:status => status}
respond_to do |format|
format.json { render_json_with_callback(hash.to_json) }
end
end
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment