CoffeeScript Programming with jQuery, Rails, and Node.js

CoffeeScript Programming with jQuery, Rails, and Node.js
eBook: $14.99
Formats: PDF, PacktLib, ePub and Mobi formats
save 15%!
Print + free eBook + free PacktLib access to the book: $44.98    Print cover: $29.99
save 33%!
Free Shipping!
UK, US, Europe and selected countries in Asia.
Also available on:
Table of Contents
Sample Chapters
  • Learn CoffeeScript, a small and elegant language that compiles to JavaScript and will make your life as a web developer better
  • Explore the syntax of the language and see how it improves and enhances JavaScript
  • Build three example applications in CoffeeScript step by step

Book Details

Language : English
Paperback : 140 pages [ 235mm x 191mm ]
Release Date : December 2012
ISBN : 1849519587
ISBN 13 : 9781849519588
Author(s) : Michael Erasmus
Topics and Technologies : All Books, Web Development, Open Source

Table of Contents

Chapter 1: Why CoffeeScript?
Chapter 2: Running CoffeeScript
Chapter 3: CoffeeScript and jQuery
Chapter 4: CoffeeScript and Rails
Chapter 5: CoffeeScript and Node.js
  • Chapter 1: Why CoffeeScript?
    • CoffeeScript syntax
      • Semicolons and braces
      • Whitespace
      • Parenthesis
    • CoffeeScript has great function syntax
      • Return isn't required
      • Function arguments
      • Where did the var keyword go?
    • CoffeeScript handles scope better
      • Top level var keywords
    • CoffeeScript has better object syntax
      • Inheritance
      • Overwhelmed?
      • Extending prototypes
    • A few other things CoffeeScript fixes
      • Reserved words and object syntax
      • String concatenation
      • Equality
      • The existential operator
    • List comprehensions
      • The while loop
    • Conditional clauses and logical aliases
    • Array slicing and splicing
    • Destructuring or pattern matching
    • => and @
    • Switch statements
    • Chained comparisons
    • Block strings, block comments, and strings
    • Summary
    • Chapter 2: Running CoffeeScript
      • The CoffeeScript stack
      • Node.js and npm
      • Node.js, npm, and CoffeeScript on Windows
      • Installing CoffeeScript on a Mac
        • Using the Apple installer
        • Using Homebrew
        • Installing CoffeeScript with npm
      • Installing CoffeeScript on Linux
        • Ubuntu and MintOS
        • Debian
        • Other distributions
        • Installing CoffeeScript with npm
      • Building Node.js from source
        • Building on Linux or Unix
        • Building on Windows
      • Using CoffeeScript
      • The coffee command
        • The REPL
        • Running .coffee files
        • Compiling to JavaScript
        • Watching
        • Putting it all together
      • Summary
      • Chapter 3: CoffeeScript and jQuery
        • Finding and changing elements
          • The $ function
        • Utility functions
        • Ajax methods
        • Using jQuery
        • Using CoffeeScript and jQuery in the browser
          • Compiling CoffeeScript
          • jQuery and CoffeeScript
          • Testing it all
          • Running a local web server
        • Our application
          • TodoMVC
          • Our initial HTML
          • Initializing our app
          • Adding a to-do item
            • Using localStorage
          • Displaying the to-do items
          • Showing the to-do items
          • Removing and completing items
          • Now, it's your turn!
        • Summary
        • Chapter 4: CoffeeScript and Rails
          • What makes Rails special?
            • Convention over configuration
            • Don't repeat yourself (DRY)
          • Rails and JavaScript
          • Rails and CoffeeScript
          • Installing Rails
            • Installing Rails using RailsInstaller
            • Installing Rails using RVM
            • Got Rails installed?
          • Developing our Rails application
            • MVC
          • Running our application
          • Our todo_items resource
          • routes.rb
          • The controller
          • The view
          • The CSS
          • Our model
          • Migrations
          • The Rails console
          • Displaying the items in our view using ERB
          • Creating a partial
          • Adding new items
          • Let's try and add a to-do item
          • Adding a CoffeeScript view
          • CoffeeScript in the asset pipeline
          • Completing the to-do items
          • Removing tasks
          • Now, it's your turn
        • Summary
          • Chapter 5: CoffeeScript and Node.js
            • Node is event-driven
            • Node is fast and scalable
            • Node is not Rails
            • Node and CoffeeScript
            • "Hello World" in Node
            • Express
            • WebSocket
            • Jade
            • Our application
            • Let's get started
              • package.json
              • Installing our modules
              • Creating our app
              • Running our application
            • Creating a view
            • node-supervisor
            • The to-do list view
              • Middleware
              • Our stylesheet
            • The client side
            • Adding collaboration
            • Creating the collaboration UI
            • WebSocket on the client
            • WebSocket on the server
            • Joining a list
              • The UI
              • Leaving a list
              • Testing it all
            • Adding to-do items to a shared list
            • Removing to-do items from a shared list
              • Now, it's your turn
            • Summary

            Michael Erasmus

            Michael Erasmus has been developing software for over 10 years. He has been a C# programmer for quite a few of them, but has luckily been enlightened enough to become an open source zealot during the last few years. The most loved tools in his utility belt are Ruby and Rails, Linux, MongoDB, Vim, jQuery, and CoffeeScript. He's interested in all manner of science and technology, but tends to dwell on things such as elegant and eccentric programming languages, machine learning and statistics, web development, Internet startups, and civic hacking. He is currently working at, building a service that will help change people's behavior and do more with the money they have. When he's not sitting in front of the computer, he likes pulling faces to amuse his baby son, apologizing to his wonderful wife for sitting in front of a computer all day, or arguing endlessly with friends, family, colleagues, and random strangers. He lives near the beach in Muizenberg, Cape Town and loves it.
            Sorry, we don't have any reviews for this title yet.

            Code Downloads

            Download the code and support files for this book.

            Submit Errata

            Please let us know if you have found any errors not listed on this list by completing our errata submission form. Our editors will check them and add them to this list. Thank you.

            Sorry, there are currently no downloads available for this title.

            Frequently bought together

            CoffeeScript Programming with jQuery, Rails, and Node.js +    Drupal 7 Module Development [Video] =
            50% Off
            the second eBook
            Price for both: £9.99

            Buy both these recommended eBooks together and get 50% off the cheapest eBook.

            What you will learn from this book

            • The basics of the language and how it compares to JavaScript
            • CoffeeScript’s powerful class syntax
            • Installing CoffeeScript on Windows, Mac OSX, and Linux using Node.js
            • Configuring CoffeeScript for browser applications
            • The basics of jQuery and using it with CoffeeScript
            • Using localStorage in browser-based applications
            • Two approaches to write CoffeeScript in Rails applications
            • Creating responsive web applications using WebSocket

            In Detail

            CoffeeScript is a young but popular language that makes web programming fun and more productive. It compiles to JavaScript and unleashes its powerful features while not straying too far from the language. It’s become one of the most popular languages on Github and is being used for both browser and server side programming.

            "CoffeeScript programming with jQuery, Rails, and Node.js" will not only teach you the CoffeeScript language but also show you how it’s being used by professional programmers with the latest web technologies.

            This book will teach you the basics of the language, focusing particularly on how it improves on JavaScript. It then focuses on building real life projects in CoffeeScript using jQuery, Rails, and Node.js.

            We look at CoffeeScript as a language that takes the power of JavaScript and presents it in an elegant and concise syntax. We will then see how we can use its power to write beautiful and short programs for various environments and how it complements the latest and greatest web frameworks.

            CoffeeScript programming with jQuery, Rails, and Node.js is all you need to become well versed with this great language and set you on your way to using it to write web applications.


            It’s a quick guide for programming CoffeeScript and then diving into programming with Rails, jQuery, and Node.js.

            Who this book is for

            This book is for web developers who would like to learn programming with CoffeScript. It is also for developers who have some experience in JavaScript and are curious to learn CoffeScript and build applications with it.

            Code Download and Errata
            Packt Anytime, Anywhere
            Register Books
            Print Upgrades
            eBook Downloads
            Video Support
            Contact Us
            Awards Voting Nominations Previous Winners
            Judges Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software
            Open Source CMS Hall Of Fame CMS Most Promising Open Source Project Open Source E-Commerce Applications Open Source JavaScript Library Open Source Graphics Software