mercredi 10 juin 2015

Rails 3 join where query - print only on row

I have two models, Campaigns and Orders I would like to find a specifik campaign with it orders and print all emails.

I tried this in the console but get all the orders data when I only want the row :email

Campaign.find_by_id(46).orders(:email)

How to I only print the emails of those orders?

Aucun commentaire:

Enregistrer un commentaire