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
    6. www.PacktPub.com
      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
O'Reilly logo

Developing our Rails application

We'll take parts of our existing to-do list application and extend it with a server-side backend using Rails. If you weren't following along in the previous chapter, then you should be able to just copy the code for that chapter as needed.

Note

This chapter isn't meant to be a complete introduction to all of Ruby on Rails or Ruby, the language. Here, we would like to focus on building a simple Rails app within the context of how you would go about using Rails with CoffeeScript.

We will not go into everything in too much detail, and we'll trust in the fact that Ruby is quite a simple and readable language and that Rails code is simple to understand. Even if you aren't familiar with the language and the framework, it ...

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