Saturday, July 30, 2011

Rails Again

I started digging into Rails again. The stuff I started to do was quite straight forward. The DB access, change routes etc. But the things I want to talk about was Haml and Coffeescript.

Haml :
Wow ! Just Wow !
I always wanted a templating engine which I could use to write easy code. Writing HTML was never so fun. The syntax might seem to be complex but trust me it gets to be fun. 

Just add a
config.generators do |g|
      g.template_engine :haml
end
in application.rb after adding the haml gem and the haml-rails gem.

Coffeescript :
This is an intermediate compiler which converts a file into javascript. Eliminate your braces and semicolons with coffeescript. The compiled output is readable and pretty-printed, passes through JavaScript Lint without warnings, will work in every JavaScript implementation, and tends to run as fast or faster than the equivalent handwritten JavaScript.

You will have to install barista, bisttro_car, coffeescript and coffeescript-script gems. I found an article which would be useful here.

Have Fun coding !




Wednesday, July 27, 2011

Oatmeal

The oatmeal has been one of the best sites for satirical humour. Just pasting one of their comics :)

What would don draper do?