ajax - Ruby on Rails Active Record Associations inherited attributes -
so working on first ror application, , 1 task away calling done (for of course). application processes background checks casino. there applicant model, , investigation model. in investigation model used applicant_id foreign key , linked them 1 one relationship. every applicant has 1 background check every background check has 1 applicant. think logic correct.
now on show view display more information applicant participated in background check. applicant.first_name can't find on how print information. thanks
can
investigation.applicant_first_name i don't know syntax thanks
assuming have controller , model set up:
<% @investigation.applicants.each |applicant| %> <p> <%= applicant.first_name %> </p> <% end %>
Comments
Post a Comment