O'Reilly logo

CoffeeScript Application Development by Ian Young

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Using CoffeeScript with Rails

Ruby on Rails is a popular server-side framework for web applications. Rails has recently adopted first-class support for CoffeeScript, making it the preferred choice for client-side code in Rails applications. Rails uses an asset pipeline to compile CoffeeScript (among other things). This is some code that takes assets such as scripts and style sheets, and compiles and prepares them for consumption by a browser. We'll walk through the steps to get your CoffeeScript running smoothly in Rails with the asset pipeline, and we'll port our pet shop application to Rails to try it out.

Setting up the asset pipeline

The steps we'll need to follow depend on which version of Rails we are working with, and whether it is a new ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required