mirror of
https://github.com/Shopify/liquid.git
synced 2026-10-03 09:05:13 -07:00
Updated Liquid for Programmers (markdown)
@@ -142,6 +142,11 @@ or
|
|||||||
@template.render('multiply_by' => 3) # => 15
|
@template.render('multiply_by' => 3) # => 15
|
||||||
```
|
```
|
||||||
|
|
||||||
|
## Difference Between Assigns and Registers
|
||||||
|
When you render a template, you can pass it assigns and registers. The difference is subtle: assigns are exposed to the template, while registers are exposed to Drops, Tags, and Filters.
|
||||||
|
```
|
||||||
|
@template.render({}, registers: { user: @user })
|
||||||
|
```
|
||||||
|
|
||||||
### Create your own tag blocks
|
### Create your own tag blocks
|
||||||
|
|
||||||
@@ -180,9 +185,3 @@ If you get errors like `A copy of ... has been removed from the module tree but
|
|||||||
# in config/environments/development.rb and config/environments/test.rb
|
# in config/environments/development.rb and config/environments/test.rb
|
||||||
Liquid.cache_classes = false
|
Liquid.cache_classes = false
|
||||||
```
|
```
|
||||||
|
|
||||||
## Difference Between Assigns and Registers
|
|
||||||
When you render a template, you can pass it assigns and registers. The difference is subtle: assigns are exposed to the template, while registers are exposed to Drops, Tags, and Filters.
|
|
||||||
```
|
|
||||||
@template.render({}, registers: { user: @user })
|
|
||||||
```
|
|
||||||
Reference in New Issue
Block a user