I'm creating an object:
artist = Artist.create(:name => "Jbeebs",
:genre => "bestmusicever",
:plays => "toomany")
I would like the variable artist
to only have the name
and genre
attributes so I can return artist.name
and artist.genre
, but nothing else.
Is there something like select for creates?
I have an array of artists and would like to return only name and genre of each when I'm outputting JSON.