Topic: Getting at parameters of join table in :through relationship
I have am new here.
I am trying to do something along the following lines:
class Person < ActiveRecord::Base
has_many :organizations, :through => :affiliations
class Organization < ActiveRecord::Base
has_many :people, :through => :affiliations
has_many :board_members, :through => :affiliations, :source => :person,
:conditions => 'affiliations.relationship = "Board Member"'
In my "join table" (affiliations), there are columns beyond just "person_id" and "organization_id" -- for example, we may have a "remarks" column of type mediumtext. My question is, how can I get at these other columns from my view? Here is an example:
Now, in the view, I have a page for showing an organization, and in that page, I hae:
<!-- other content before here -->
<% for board_member in @organization.board_members %>
<li><%= link_to(board_member.first+" "+board_member.last,
:controller => 'person',
:action => 'show',
:id => board_member) %><br />
XXX Here is where I want to put affiliation.remarks XXX
<!-- other content after here -->
Any suggestions? I've tried board_member.affiliation.remarks with no success...