Rendering dynamic content in a web application can be done using many tools, one of them is using a Javascript Template Engine. It uses a language with specific markup designed to render dynamic content to the Document Object Model.
Most of the markup used by javascript template engines resembles HTML, but some go further by introducing a new markup designed with a specific goal in mind. Jade has a unique characteristic compared to other javascript template languages. It simplifies the markup by removing the use of angle brackets and closing tags.
In this article, I will be demonstrating how to integrate Jade into a Ruby on Rails application. As an example, the application will be twitter-like, including timeline and user profile features to demonstrate the integration.
Some code examples in this article are taken from the example application, and some are simplified code taken from the code example. The completed version is available at Github, and there is also an online version available to demonstrate how it looks.
Continue reading %Integrating Jade Templates into Rails for Cleaner Templates%
by Hendra Uzia via SitePoint
No comments:
Post a Comment