mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-19 02:40:41 -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:
|
||||
|
||||
module ApplicationHelper
|
||||
def truncate(input, length)
|
||||
input[0..length] + '...'
|
||||
end
|
||||
end
|
||||
<pre><code>module ApplicationHelper
|
||||
def truncate(input, length)
|
||||
input[0..length] + '...'
|
||||
end
|
||||
end
|
||||
</code></pre>
|
||||
|
||||
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