Javascript should be a better idea here. I am new to Rails and do not know how to write javascript inside rails 3. More specifically, two questions:
1. which event should I respond to? keypress, keydown,keyup? 2. Rails 3 uses Unobtrusive Javascript. All I can think of now is old obtrusive one. How can I use unobtrusive one to do this. Any help with pointing to the right direction would be greatly appreciated. Colin Law wrote in post #1037179: > On 17 December 2011 20:06, Jay Chaun <li...@ruby-forum.com> wrote: >> I am learning Rails 3 and need some help on Ajax part. >> >> I am trying to accomplish the following: >> There is a textarea on the page which has a length of letters >> constraint, say 100. Every time a symbol is typed there,a nearby label >> tells you how many letters you have left. >> >> I plan to use Ajax to do this. > > If you do that then every time a letter is typed it will have to send > a request to the server, which is a bad idea. Use javascript instead. > > Colin -- Posted via http://www.ruby-forum.com/. -- 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 rubyonrails-talk@googlegroups.com. To unsubscribe from this group, send email to rubyonrails-talk+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/rubyonrails-talk?hl=en.