Skip to content

Commit 9fe7114

Browse files
committed
fix example code for 'builds' in README
1 parent 2462e55 commit 9fe7114

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Diff for: README.md

+6-2
Original file line numberDiff line numberDiff line change
@@ -360,9 +360,13 @@ Builders allow instantiating different cell classes for different models and opt
360360

361361
```ruby
362362
class CommentCell < Cell::ViewModel
363+
include ::Cell::Builder
364+
363365
builds do |model, options|
364-
PostCell if model.is_a?(Post)
365-
CommentCell if model.is_a?(Comment)
366+
case model
367+
when Post; PostCell
368+
when Comment; CommentCell
369+
end
366370
end
367371
```
368372

0 commit comments

Comments
 (0)