michaelanthonymain/general-activities-app — pull request #22 by michaelanthonymain (2014-04-25 02:03:07+00:00)
Title: DO NOT MERGE: This is for the ajax challenge.

This is incomplete. General comments:
1) Using Rails form_for you can set remote: true to handle the form in an AJAX way.
2) I tried on comments, and using the remote: true method broke our custom url path somehow (kept getting the template missing error for the comments/create path even though we specify event_comments_path in the url option.
3) respond_to |format| block is set in the controller to determine the appropriate actions based on the response type that we're looking for. html, redirect as normal. js, write a line of js in a corresponding create.js.erb.
4) We are displaying comments by querying the database for all comments with a particular event id. Most examples of ajax show the js appending a partial to the list of comments (or tasks, whatever). If we wanted to keep displaying our comments in the same way, I'm not sure how to write AJAX for it. Seems like appending makes more sense for ajax.