pluck and select
pluckreturn Array object as the resultselectreturn ActiveRecord::Relation object as the resultselectalways returnsid: nilproperty in your ActiveRecord results if you don't select:id. For converting your object to json without id:nil, you could do as following:record(s).to_json(only:[:column1, :column2, ...:column3])photos = Photo.select(:name, :path_original, :path_small) respond_with photos.to_json(only: [:name, :path_original, :path_small])