Chapter 16. Blog comments with Ajax

In this chapter, we extend the RailsSpace blog engine by allowing users to comment on blog posts. After all our hard work on RESTful blogs and posts in Chapter 15, comments by themselves are relatively straightforward, so we’ll keep things interesting by using Ajax to implement them. Since our comments are RESTful as well, we’ll have a chance to see how nicely REST and Ajax play together.

Although there are plenty of useful new techniques in this chapter, including several Rails Ajax helpers and the remarkable Ruby JavaScript (RJS), we should note that there is a layer of code that we will not explain. We will peek under the hood to see some of the code that produces the Ajax effects, but ultimately the actual ...

Get RailsSpace: Building a Social Networking Website with Ruby on Rails™ now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.