Forum: Ruby on Rails How does observe_field work recursively

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
7fbd0e99b27064b14793f028022974e5?d=identicon&s=25 Zhao Yi (youhaodeyi)
on 2009-01-07 03:25
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.
81b61875e41eaa58887543635d556fca?d=identicon&s=25 Frederick Cheung (Guest)
on 2009-01-07 10:48
(Received via mailing list)
On Jan 7, 2:25 am, Zhao Yi <rails-mailing-l...@andreas-s.net> 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
This topic is locked and can not be replied to.