mirror of
https://github.com/Shopify/liquid.git
synced 2026-10-03 09:05:13 -07:00
Migrated from using-liquid-without-rails v5
@@ -3,13 +3,15 @@ The secret is creating a @to_liquid@ method on any classes you create.
|
|||||||
|
|
||||||
Let's say you have a Product class:
|
Let's say you have a Product class:
|
||||||
|
|
||||||
<pre><code>class Product
|
<pre><code>
|
||||||
|
class Product
|
||||||
attr_accessor :name, :price
|
attr_accessor :name, :price
|
||||||
def initialize(name,price)
|
def initialize(name,price)
|
||||||
@name = name
|
@name = name
|
||||||
@price = price
|
@price = price
|
||||||
end
|
end
|
||||||
end</code></pre>
|
end
|
||||||
|
</code></pre>
|
||||||
|
|
||||||
And you have a chunk of text that you want to Liquidize by inserting some details about your products:
|
And you have a chunk of text that you want to Liquidize by inserting some details about your products:
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user