# Has\_many :through, form for join model attributes

**URL:** <https://www.ruby-forum.com/t/has-many-through-form-for-join-model-attributes/59314>\
**Category:** Rails\
**Created:** [May 3, 2006, 6:56pm UTC](https://www.ruby-forum.com/t/has-many-through-form-for-join-model-attributes/59314 "2006-05-03T18:56:54Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![dmarkow](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bc8723/32.png) [@dmarkow](https://www.ruby-forum.com/u/dmarkow)\
**Post date:** [May 3, 2006, 6:56pm UTC](https://www.ruby-forum.com/t/has-many-through-form-for-join-model-attributes/59314/1 "2006-05-03T18:56:54Z")

</div>

I have the following schema:

class ClientsProject \< ActiveRecord::Base  
belongs\_to :client  
belongs\_to :project  
end

class Client \< ActiveRecord::Base  
has\_many :clients\_projects  
has\_many :projects, :through =\> :clients\_projects  
end

class Project \< ActiveRecord::Base  
has\_many :clients\_projects  
has\_many :clients, :through =\> :clients\_projects  
end

I have a form to show the Project model. This form lists each  
client’s name and contact information. I would also like to list the  
client’s file\_number for this project. File\_number is a column in my  
clients\_projects table. I would like to insert a field to access and  
edit each client’s file number in this form, but I don’t know how to  
go about it:

\<% @clients.each do |c| %\>

 Client:  
 \<%= link\_to '(edit info)', :controller =\> 'clients', :action =\> 'edit', :id =\> c.id %\>  
 \<%= "#{client.display\_name}  
" %\> \<%= THIS IS WHERE I WANT A TEXT FIELD TO UPDATE EACH CLIENT'S FILE NUMBER %\> \<% end %\>

---

<div class="post-metadata">

**Author:** ![dmarkow](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/d/bc8723/32.png) [@dmarkow](https://www.ruby-forum.com/u/dmarkow)\
**Post date:** [June 26, 2007, 1:27pm UTC](https://www.ruby-forum.com/t/has-many-through-form-for-join-model-attributes/59314/2 "2007-06-26T13:27:32Z")

</div>

Hi Dylan

Did you ever find a solution for this problem?
