I didn't add the .clone, and don't have any opinion on it.   Not sure, but maybe params[:object] was really for json_xml.  I think the if else vs. ? : was at your suggestion, but that may be another code chunk.