ActionView::Template:Error(undefined method 'first_name' for nil:NilClass)
问题 My app seems to randomly be throwing an error when users are trying to load grid data into the form: ActionView::Template::Error (undefined method `first_name' for nil:NilClass): 3: t = @conts 4: xml.tag!("row",{ "id" => t.id }) do 5: 6: xml.tag!("cell", t.first_name) 7: xml.tag!("cell", t.last_name) 8: xml.tag!("cell", t.email) 9: xml.tag!("cell", t.phone_1) And following is the controller file def compdata @conts = Continfo.find_by_id(params[:id]) end Correspondence compdata RXML file xml