Blah Blah Woof Woof

Archived content 2005-2007

Rails Tip: Pointing observe_field to an invalid DOM ID breaks all subsequent observers

Posted by Tim Riley Fri, 10 Aug 2007 07:28:00 GMT

Be careful when use use Rails' observe_field helper. If you point observe_field to an invalid DOM ID, then all subsequent field observers on the page will fail to work.

This is easily avoided if you are using the helper manually. However, if you are programatically generating observers, they do not fail gracefully, so make sure that you only create them if the necessary IDs are present.


(leave url/email »)