Is there any good reason why most rails developers use observe_field when they want trigger specific action when text input box is changed, rather then using onkeydown? I would expect, that in most of the cases using observe_field results much more code generated than just using native hook onkeydown.
A:
I think it's just a convenient way rails supplied for the person who doesn't know about javascript, or who doesn't want to write another piece of JavaScript code.
allenwei
2010-06-01 01:12:39
it is possible to use onkeydown withut writing any javascript - something like: :onkeydown => update_page { |page| page[:item].toggle }
gorn
2010-06-02 11:06:32