i have a model called certification_types that i’ve declared as
acts_as_tree. I have a model called certification that belongs_to
class CertificationController < ApplicationController
@certifications = Certification.find(:all, :order=>‘date’)
<% for certification in @certifications %>
<%= certification.certification_type.parent.id %>
<% end %>
so, the line above (<%=
certification.certification_type.parent.type_description %> ) does not
work; it says The error occured while evaluating nil.type_description.
if i do a debug(certification.certification_type.parent) it shows that i
have a hash of values:
type_description: Allergy & Immunology
can anyone help me with how to access the parent type_description when
looping through my collection?