# How does observe\_field work recursively

**URL:** <https://www.ruby-forum.com/t/how-does-observe-field-work-recursively/157070>\
**Category:** Rails\
**Created:** [January 7, 2009, 3:25am UTC](https://www.ruby-forum.com/t/how-does-observe-field-work-recursively/157070 "2009-01-07T03:25:44Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![youhaodeyi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/b9bd4f/32.png) [@youhaodeyi](https://www.ruby-forum.com/u/youhaodeyi)\
**Post date:** [January 7, 2009, 3:25am UTC](https://www.ruby-forum.com/t/how-does-observe-field-work-recursively/157070/1 "2009-01-07T03:25:44Z")

</div>

I use observe\_field in a view page to monitor a field (field1). Whenever  
field1 changed, a action will render a partial (partial1). In partial1,  
I use observe\_field to monitor a field (field2).

so the problem is: when a user changed the field1, its action will set  
some variables and render the partial1. In partial1, the field2 changed  
because of some variables changed in the action, but the observe\_field  
doesn’t invoke its action. If the user changed the field2 manually, the  
observe\_field works fine. So I wander why the observe\_field doesn’t work  
if the field changed according to a render.

---

<div class="post-metadata">

**Author:** ![youhaodeyi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/y/b9bd4f/32.png) [@youhaodeyi](https://www.ruby-forum.com/u/youhaodeyi)\
**Post date:** [January 7, 2009, 10:48am UTC](https://www.ruby-forum.com/t/how-does-observe-field-work-recursively/157070/2 "2009-01-07T10:48:32Z")

</div>

On Jan 7, 2:25 am, Zhao Yi [removed\_email\_address@domain.invalid](mailto:removed_email_address@domain.invalid) wrote:

> I use observe\_field in a view page to monitor a field (field1). Whenever  
> field1 changed, a action will render a partial (partial1). In partial1,  
> I use observe\_field to monitor a field (field2).
> 
> so the problem is: when a user changed the field1, its action will set  
> some variables and render the partial1. In partial1, the field2 changed  
> because of some variables changed in the action, but the observe\_field  
> doesn’t invoke its action. If the user changed the field2 manually, the  
> observe\_field works fine. So I wander why the observe\_field doesn’t work  
> if the field changed according to a render.

That’s normal. observe\_field observes user triggered events not things  
like javascript updating the page.

Fre
