I want to make a selection list, which I call a dropdown, which, when
a user makes his or her selection, will do an ajax call, and update a
partial. Without hitting a button -- the ajax request will fire off
upon the selection.
I'd appreciate a hint -- can't figure out where to start.
The Agile Book is always a good place to start looking for things
Rails. In your case, page 523-526 in the 2nd Edition has some good
stuff that can get you started on what you want.
Is a form observer the way to go with this? I was thinking of just
doing an onchange, so that when any element is selected, it fires off
an ajax request.
Either way would work. I prefer to write less
javascript and let the observer deal w/ the ajax request, but they will
both do basically the same thing one is a little more rails, the other
a little more javascript.
I use observers for this all the time doing exactly
what you want. I use it in my pagination footer. I give the user a list
of available pages, and if a new page is chosen, the observer fires off
an ajax request which then uses rjs to update the page results.