What is the best way if i would like to only return :id and :name fields in JSON
So far i have:
format.json { render :json => @contacts.map(&:attributes) , :only => ["id"]}
But the "name" attribute does not work in the :only section, since it is not a column in the database (it is defined in the model as firstname + lastname)
Thanks!