Blog Post Index Example

The URL for your blogging backend that retrieves an index of all posts looks like this:

http://wwwr.cs.unc.edu/emilyblog/posts.json

The responseJSON property of the Ajax.Response object that is sent to the onSuccess handler will contain a JavaScript array. Each entry in the array will be a object that represents each blog post. These entry objects will each contain the following properties:

id
The numeric ID associated with this blog post.
title
The title of the blog post as a string.
body
The body of the blog post as a string.
created_at
The date that the blog post was created as a string.

Other notes:

To test this URL, click on the following button. Look at the code in posts_index_example.js to see how it works.