# Setting attributes on a has\_many through relationship

**URL:** <https://www.ruby-forum.com/t/setting-attributes-on-a-has-many-through-relationship/166399>\
**Category:** Rails\
**Created:** [April 24, 2009, 8:01pm UTC](https://www.ruby-forum.com/t/setting-attributes-on-a-has-many-through-relationship/166399 "2009-04-24T20:01:02Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![snowbird122](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/s/c68b51/32.png) [@snowbird122](https://www.ruby-forum.com/u/snowbird122)\
**Post date:** [April 24, 2009, 8:01pm UTC](https://www.ruby-forum.com/t/setting-attributes-on-a-has-many-through-relationship/166399/1 "2009-04-24T20:01:02Z")

</div>

The has\_many through setup detailed below allows me to do  
@system.software \<\< and @software.systems \<\< for establishing the  
relationships, using an array of software or system objects,  
respectively. This works out well because my form for software has a  
software\_ids multi-select. The problem I have is that the join model  
has additional attributes to store. Can I use the above method and  
somehow also include the additional attributes or do I have to do x =  
SystemSoftware.new… x.system\_status = SystemStatus.find(params  
[:system\_status\_id]…etc.?

System.rb

has\_many :system\_software  
has\_many :software, :through =\> :system\_software

Software.rb

has\_many :system\_software  
has\_many :software, :through =\> :system\_software

SystemSoftware.rb

belongs\_to :system  
belongs\_to :software
