Here I want to show the extra attribute CONFIRMED from the employments join table. What am I doing wrong?
class Job < ActiveRecord::Base
has_many :employments, :dependent => :destroy
has_many :users, :through => :employments
class User < ActiveRecord::Base
has_many :employments
has_many :jobs, :through => :employments
class Employment < ActiveRecord::Base
belongs_to :job
belongs_to :user # Employment has an extra attribute of confirmed ( values are 1 or 0)
In my job view I want to show the confirmed value for each job. I just cant seem to get it. In my view i have:
<% @job.each do |job| %>
<tr class="<%= cycle('oddrow', 'evenrow') %>">
<td><%= link_to job.clientname, job_url(job.id) %></td>
<td><%= job.eventtype.name %></td>
<td><% unless job.starts_at.blank? %><%= job.starts_at.to_formatted_s(:full) %><% end %></td>
<td>7 - 12 </td>
Here I want to show the extra attribute CONFIRMED from the employments join table. What am I doing wrong?
<td><%= job.employment.confirmed %></td>
</tr>
<% end %>
Thanks