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.instruct! :xml, :version=>"1.0"
xml.tag!("rows") do
t = @conts
xml.tag!("row",{ "id" => t.id }) do
xml.tag!("cell", t.first_name)
xml.tag!("cell", t.last_name)
xml.tag!("cell", t.email)
xml.tag!("cell", t.phone_1)
xml.tag!("cell", t.phone_2)
xml.tag!("cell", t.homepage)
xml.tag!("cell", t.skype)
end
end