mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-20 03:10:39 -07:00
Write a small message here explaining this change. (Optional)
Updated Getting Liquid to Work in Rails (textile)
@@ -10,12 +10,14 @@ A note about helpers. The liquid rails plugin tries to use your helpers as Filte
|
|||||||
|
|
||||||
Helper:
|
Helper:
|
||||||
|
|
||||||
module ApplicationHelper
|
<pre><code>module ApplicationHelper
|
||||||
def truncate(input, length)
|
def truncate(input, length)
|
||||||
input[0..length] + '...'
|
input[0..length] + '...'
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
Liquid:
|
Liquid:
|
||||||
|
|
||||||
{{ 'This is a long section of text' | truncate: 3 }} #=> Thi...
|
<pre><code> {{ 'This is a long section of text' | truncate: 3 }} #=> Thi...
|
||||||
|
</code></pre>
|
||||||
Reference in New Issue
Block a user