A Rails Developer’s impression of CoffeeScript – Part 2

We had a look at the basics of CoffeeScript in the previous post. In this tutorial, we’ll see how it is supported in Rails and how can we use it. Ruby CoffeeScript is a ruby bridge to the CoffeeScript compiler. The coffee-script library will automatically choose the best JavaScript engine for our platform. The available engines are V8, Node.js, and JavaScriptCore. To use CoffeeScript with Rails 3.0.x We can use either of the two gems available: – Barista – gem that provides CoffeeScript support for Rails and Rack apps – BistroCar – another gem that serves up CoffeeScript from within our Rails application The latest versions of…

A Rails developer’s impression of CoffeeScript – Part 1

DHH has announced that Rails 3.1 will ship with CoffeeScript as default option for writing JavaScript. All web apps use JavaScript (if you don’t, I don’t want to know you! ), and most Rails developers who are used to writing clean and pretty ruby code find it cumbersome to write JavaScript with all its curly braces and colons, (well, at least I did). Compared to that, CoffeeScript is wonderfully easy to understand and maintain. Lets hear it direct from the horse’s mouth – CoffeeScript is neat language that provides an alternative syntax for writing JavaScript; the code compiles one-to-one into the equivalent JS, and there is no…