mirror of
https://github.com/Shopify/liquid.git
synced 2026-09-17 18:00:41 -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
|
||||
attr_accessor :name, :price
|
||||
def initialize(name,price)
|
||||
def initialize(name, price)
|
||||
@name = name
|
||||
@price = price
|
||||
end
|
||||
to_liquid
|
||||
{ :name => self.name,
|
||||
:prict => self.price }
|
||||
{ "name" => self.name,
|
||||
"price" => self.price }
|
||||
end
|
||||
end</code></pre>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user