Posts Tagged ‘liquid’

Liquid Basics

Posted in Rails, Ruby, Ruby on Rails, liquid, ror on March 3rd, 2009 by admin – 1 Comment

Liquid is a template engine extracted from the e-commerce system Shopify. Now t is a stand alone ruby library. Liquid can be used either in a Ruby application or in a Ruby On Rails application

Why Should We Use liquid ?

  1. Allow users to edit the appearance of your application.
  2. Easy and secure.
  3. Render templates directly from the database.
  4. Style HTML as well as emails.
  5. Extending Liquid is very easy
  6. Simple markups.
  7. If you like Smarty-style template engines

How to get it?

Liquid can be installed either as liquid gem or plugin.

Plugin can be installed simply with by script/install:

RubyGems

Liquid Basics
Liquid have two type of markups

  • Output markup (which may resolve to text)

             {{ matched pairs of curly brackets (ie, braces) }}
example

  • Tag markup (which cannot resolve to text and are used for logic)

             {% matched pairs of curly brackets and percent signs %}
example