I have following many to many relationship:
class Service < ActiveRecord::Base
has_many :service_dependencies
has_many :dependents, :through => :service_dependencies
end
class ServiceDependency < ActiveRecord::Base
belongs_to :service
belongs_to :dependent, :class_name => ''Service'',
:foreign_key =>
''dependent_service_id''
end
However, in my schema the MTM table service_dependencies has few
relationship attributes as well, e.g. impact, severity, etc. along
with the foreign keys.
Right now, I''m displaying the dependent services'' fields in
following
manner:
<% for dependents in @service.dependents %>
     <b>Service Name:</b><br> <%=h
dependents.send("service_name")
%><br>
<% end %>
I want to display the relationship attributes, impact, severity as well,
could someone please help me by letting me know how to access them in my
view page?
-- 
Posted via http://www.ruby-forum.com/.
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"Ruby on Rails: Talk" group.
To post to this group, send email to
rubyonrails-talk-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
To unsubscribe from this group, send email to
rubyonrails-talk-unsubscribe-/JYPxA39Uh5TLH3MbocFFw@public.gmane.org
For more options, visit this group at
http://groups.google.com/group/rubyonrails-talk?hl=en
-~----------~----~----~----~------~----~------~--~---