From 4396d385c9143b538542f065f14bea9d8ecae11c Mon Sep 17 00:00:00 2001 From: tobi Date: Thu, 12 Aug 2010 13:45:48 -0700 Subject: [PATCH] Migrated from getting-liquid-to-work-in-rails v2 --- Getting-Liquid-to-Work-in-Rails.textile | 22 +++++++++++++++++++--- 1 file changed, 19 insertions(+), 3 deletions(-) diff --git a/Getting-Liquid-to-Work-in-Rails.textile b/Getting-Liquid-to-Work-in-Rails.textile index ebca1e5..d3ab96e 100644 --- a/Getting-Liquid-to-Work-in-Rails.textile +++ b/Getting-Liquid-to-Work-in-Rails.textile @@ -1,5 +1,21 @@ --- this is a stub +Liquid comes with a proper init.rb by default. -Need to know how to integrate Liquid into Rails. +To start using liquid just extract it into vendor/plugins or better yet use the ./script/plugin script to install liquid. -Is there a guide on the web? \ No newline at end of file +You can now start using templates with the .liquid file type. + +h3. Notes + +A note about helpers. The liquid rails plugin tries to use your helpers as Filters. Your helpers will always receive the piped in text as first parameter and any Filter parameters after this. + +Helper: + + module ApplicationHelper + def truncate(input, length) + input[0..length] + '...' + end + end + +Liquid: + + {{ 'This is a long section of text' | truncate: 3 }} #=> Thi... \ No newline at end of file