Thanks for the example. It was really helpful.
I pulled the example and try it out using my own sample app. I deploy it to heroku and when I try the canvas, I receive FMBL error for illegal body tag.
To solve this issue, I went to my app page on facebook, go to advance settings, and under canvas settings, set the canvas type to iframe. After that, it works.
I guess it's not an issue but perhaps someone can benefit from this.