mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-20 03:10:39 -07:00
Migrated from using-liquid-without-rails v3
@@ -29,13 +29,13 @@ to_liquid? Where did that come from? Turns out you need to add a method to your
|
|||||||
|
|
||||||
<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
|
||||||
to_liquid
|
to_liquid
|
||||||
{ :name => self.name,
|
{ "name" => self.name,
|
||||||
:prict => self.price }
|
"price" => self.price }
|
||||||
end
|
end
|
||||||
end</code></pre>
|
end</code></pre>
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user