You are previewing CoffeeScript Programming with jQuery, Rails, and Node.js.

CoffeeScript Programming with jQuery, Rails, and Node.js

Cover of CoffeeScript Programming with jQuery, Rails, and Node.js by Michael Erasmus Published by Packt Publishing
  1. CoffeeScript Programming with jQuery, Rails, and Node.js
    1. Table of Contents
    2. CoffeeScript Programming with jQuery, Rails, and Node.js
    3. Credits
    4. About the Author
    5. About the Reviewers
      1. Support files, eBooks, discount offers and more
      2. Why Subscribe?
    7. Preface
      1. What this book covers
      2. What you need for this book
      3. Who this book is for
      4. Conventions
      5. Reader feedback
      6. Customer support
    8. 1. Why CoffeeScript?
      1. CoffeeScript syntax
      2. CoffeeScript has great function syntax
      3. CoffeeScript handles scope better
      4. CoffeeScript has better object syntax
      5. A few other things CoffeeScript fixes
      6. List comprehensions
      7. Conditional clauses and logical aliases
      8. Array slicing and splicing
      9. Destructuring or pattern matching
      10. => and @
      11. Switch statements
      12. Chained comparisons
      13. Block strings, block comments, and strings
      14. Summary
    9. 2. Running CoffeeScript
      1. The CoffeeScript stack
      2. Node.js and npm
      3. Node.js, npm, and CoffeeScript on Windows
      4. Installing CoffeeScript on a Mac
      5. Installing CoffeeScript on Linux
      6. Building Node.js from source
      7. Using CoffeeScript
      8. The coffee command
      9. Summary
    10. 3. CoffeeScript and jQuery
      1. Finding and changing elements
      2. Utility functions
      3. Ajax methods
      4. Using jQuery
      5. Using CoffeeScript and jQuery in the browser
      6. Our application
      7. Summary
    11. 4. CoffeeScript and Rails
      1. What makes Rails special?
      2. Rails and JavaScript
      3. Rails and CoffeeScript
      4. Installing Rails
      5. Developing our Rails application
      6. Summary
    12. 5. CoffeeScript and Node.js
      1. Node is event-driven
      2. Node is fast and scalable
      3. Node is not Rails
      4. Node and CoffeeScript
      5. "Hello World" in Node
      6. Express
      7. WebSocket
      8. Jade
      9. Our application
      10. Let's get started
      11. Creating a view
      12. node-supervisor
      13. The to-do list view
      14. The client side
      15. Adding collaboration
      16. Creating the collaboration UI
      17. WebSocket on the client
      18. WebSocket on the server
      19. Joining a list
      20. Adding to-do items to a shared list
      21. Removing to-do items from a shared list
      22. Summary
    13. Index

Our application

In the rest of this chapter, we will be building a jQuery application using CoffeeScript. The application is a to-do list app, which can be used to keep track of your daily tasks and how you completed them.


I have modeled a lot of the application on some of the TodoMVC project's source code, which is in the public domain. This project is a showcase of different JavaScript MVC frameworks all used to build the same application, and can be very useful when evaluating frameworks. If you wanted to check it out, it can be found at


MVC , or Model–view–controller, is a widely used application architecture pattern that aims to simplify code and reduce coupling by splitting application concerns ...

The best content for your career. Discover unlimited learning on demand for around $1/day.