I have two models, Reports(belongs to client) and Clients(has many reports). A Client has an attribute or column called “specialty”. What I’m trying to do is to be able to call and display the Client.specialty attribute for that particular @client when inside the show page of a @client’s Report. In my Report model I do have a “client_id” foreign key. I have no idea how to do this, I’ve gone about this far:
@report.client_id
This obviously displays a number, but I don’t know how to go any further, In my noob ways I want to do something like this:
@report.client_id.specialty
But that doesn’t work obviously. How do I do this?
why not the following?