# Updating sub-attirbutes without selecting the parent

**URL:** <https://www.ruby-forum.com/t/updating-sub-attirbutes-without-selecting-the-parent/185771>\
**Category:** Rails\
**Created:** [March 25, 2010, 8:45pm UTC](https://www.ruby-forum.com/t/updating-sub-attirbutes-without-selecting-the-parent/185771 "2010-03-25T20:45:52Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![xman2000](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/x/9d8465/32.png) [@xman2000](https://www.ruby-forum.com/u/xman2000)\
**Post date:** [March 25, 2010, 8:45pm UTC](https://www.ruby-forum.com/t/updating-sub-attirbutes-without-selecting-the-parent/185771/1 "2010-03-25T20:45:52Z")

</div>

I am working on an application and need to be able to update a single  
field of nested record in the applications. For instance,

Library has\_many Books  
Book has\_many Chapters

I would like to be able to have a single form on the Library page that  
allows me to use a pull down list that selects the book and the chapter  
and have users be able to update that chapters’ associated fields (mark  
the chapter as updated for instance). It doesn’t need to be smart and  
pull the existing values for the chapter record. I would be happy to  
use form\_tag and make it a dumb form to just dump the data into the  
database but I am not sure how to best approach it. I have tried using  
the nested form\_for and fields\_for methods but they appear to break  
after one “layer” of nesting. Lets assume all chapters have a key field  
that is unique across the whole chapters table; is there a way I could  
create a form that would ignore associations and just look for that key  
field and update that record - ignoring that the chapter is owned by a  
book and the book is owned by a library? Thanks,
