Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,15 @@ json.array! @people, :id, :name
# => [ { "id": 1, "name": "David" }, { "id": 2, "name": "Jamie" } ]
```

To make a plain array without keys, construct and pass in a standard Ruby array.

``` ruby
my_array = %w(David Jamie)

json.people my_array

# => "people": [ "David", "Jamie" ]

You don't always have or need a collection when building an array.

```ruby
Expand Down