Using Sinatra 0.9.2 this is an easy to way to get an updating single tweet in your application. I am using the most recent HAML gem ( haml 3.0.5 ). I am also deploying this application with Heroku, not that it will make a difference, but it may help. It did take a few hours to get the function to call correctly, and the HAML ( or Sinatra ) people may say that there better ways to instantiate this, but that is why I am writing this post. You need to include two gems in your app.rb file in addition to the norm: 1 2 3 4 5 6 7 8   require ‘rubygems’ require ‘sinatra’ require ‘haml’   #[…]

I was having this issue the other day trying to get a unique javaScript class attribute to stick in HAML. HAML versus writing HTML is nice and easy in my opinion and it seems like it is saving a ton of time messing around with closing tags. This was my experience — In HAML you can simply append different id and class definitions together like this – 1 2   %div.car_chase#dredlock but I needed a class to stick which looked like this: 1 2   class="{required:true, email:true, messages:{email:’Please enter a valid email address’}}" I was getting errors by simply concatenating the elements, but then I recalled additional attributes it might look something like this: 1 2   %input#dredlock{ :alt =>[…]