I posted on here as you guys are a lot more helpful than the books have been for me in the past! Please excuse as i am still learning.
I have a Landlord MGT App which has a a House model and a Tenant Model. On the show page for the house i would like to see the tenant which has the associated house_id in its model.
show page for house
.wrapper_with_padding
%h1.showheading= 'Property Information'
#house_show
%p First Line Address: #{@house.doorno} #{@house.house_title}
%p Description: #{@house.description}
%p Tenant: #{@tenant.house.tenant_id}
Currently the above line of code for Tenant does not work and pulls NULL value.
Models
class House < ActiveRecord::Base
belongs_to :user
belongs_to :tenant
class Tenant < ActiveRecord::Base
belongs_to :user
belongs_to :house
I have nothing in my controller for show.
In summary the tenant table has a house_id attribute. On the show page for that specific house i would like to see the associated tenant_id.
Thank you in advance