# Partial not pulling through values

**URL:** <https://www.ruby-forum.com/t/partial-not-pulling-through-values/110476>\
**Category:** Rails\
**Created:** [July 26, 2007, 5:50pm UTC](https://www.ruby-forum.com/t/partial-not-pulling-through-values/110476 "2007-07-26T17:50:21Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![vanderkerkoff](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/v/7feea3/32.png) [@vanderkerkoff](https://www.ruby-forum.com/u/vanderkerkoff)\
**Post date:** [July 26, 2007, 5:50pm UTC](https://www.ruby-forum.com/t/partial-not-pulling-through-values/110476/1 "2007-07-26T17:50:21Z")

</div>

Any ideas on this would be grand

I have two models Degree and Qualification and am using a join table  
called assigned, in my edit view below I am calling the partial ‘form’  
at the start and then currently having to call my lines of code to edit  
the assigned qualifications in the edit method itself because if I put  
it in the partial it doesn’t pull through the current values of the  
grade text field and the subject dropdown, ideally I want to put it into  
the partial as my new view uses the same code

Edit view:

# Editing degree

\<%= error\_messages\_for :degree %\>

\<%= start\_form\_tag :action =\> ‘update’, :id =\> params[:id] %\>  
\<%= render :partial =\> ‘form’ %\>

Grade  
 \<%=text\_field 'assigned', 'grade' %\>

\<%@quals=Qual.find(:all)%\>

Subject  
\<%=collection\_select(:assigned, :qual\_id, @quals,:id, :screen\_qual, :prompt =\> "Select a qualification")%\>

\<%= submit\_tag “Edit” %\>  
\<%= end\_form\_tag %\>

\<%= link\_to ‘Show’, :action =\> ‘show’, :id =\> @degree %\> |  
\<%= link\_to ‘Back’, :action =\> ‘list’ %\>

form partial:

\<%= error\_messages\_for ‘degree’ %\>

Title  
\<%= text\_field 'degree', 'title' %\>

Detail  
\<%= text\_area 'degree', 'detail' %\>

Careers  
\<%= text\_area 'degree', 'careers' %\>

Contact  
\<%= text\_field 'degree', 'contact' %\>

\<% for interest in Interest.find(:all) %\>

 \<%= check\_box\_tag "degree[interest\_ids][]", interest.id, @degree.interests.include?(interest) %\> \<%= interest.name %\>
\<% end %\>
