Basically I have 3 fields in the database table and I want to return a an array to represent each row.
sqlite database resultset:
row 1)
name: John
gender: male
email: john@john.com
row 2)
name: Sarah
gender: female
email: sarah@sarah.com
Desired format from the above resultset:
[['John',male,'john@john.com'],['Sarah',female,'sarah@sarah.com']]
I’ve tried using User.all.map(&:name) but that only gives me ['John','Sarah']
You’ll want to use
map, but like this: