Hi Janna, On Sun, 2009-07-12 at 07:36 -0700, JannaB wrote: > I've implemented observe_field succesfully on other controls, but > never on a text field. For whatever reason, the following partial > never executes the action specified in the url of my observe_field > below.
> Does anyone see what I am doing wrong here and how I can make that > action fire? Thanks, Janna B. Two things .... First, look at the html in Firebug to make sure the Ajax actually exists on the page. You've got the observe_field wrapped in a condition and it may be that it's not getting rendered. Second, assuming the observer is getting rendered, it's looking for a field that doesn't exist and so will never fire. As side notes... 'and' and '&&' are not the same thing. Although it's probably not the source of your problem here, you should be aware of operator precedence. 'and' and 'or' are at the very bottom of the list. Idiom-wise 'current_associate.channel_id != nil' is more typically written '!current_associate.channel_id.nil?' It's safer to use .blank? than .nil? (or '!= nil') as it will catch nil, false, and the empty string. Lastly, :with => "'associate_inoutexplanation=' + value" is equivalent to :with => "associate_inoutexplanation". HTH Bill --~--~---------~--~----~------------~-------~--~----~ You received this message because you are subscribed to the Google Groups "Ruby on Rails: Talk" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en -~----------~----~----~----~------~----~------~--~---

