Skip to content

Commit 4814e40

Browse files
committed
Add readme to get around prism errors
1 parent bde1fb6 commit 4814e40

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,10 @@ A single layout is supported. To use, create an `application.json.props` in
623623
```ruby
624624
json.data do
625625
# template runs here.
626-
yield json
626+
_.call(json)
627+
# NOTE: you can also use `yield json` instead, but prism sees this as
628+
# a syntax error, so the `_.call(json)` is a workaround.
629+
# See: https://github.com/thoughtbot/props_template/issues/58
627630
end
628631

629632
json.header do
Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
11
json.data do
2-
yield json
2+
# yield json
3+
# also works, but prism see it as a syntax error
4+
# so we use _.call(json) instead.
5+
_.call(json)
36
end

0 commit comments

Comments
 (0)