Topic: Using AJAX in Views
I'm delving into the arena of using AJAX in Views. As a simple test, I'm wanting to do the following:
I have a table of States with an id column and a name column. I also have a table of Cities with and id column, a state_id column, and a name column.
I have a collection_select that is loaded with States data.
I would like to code my view in such a way that when a state is selected, a second collection_select is populated with cities belonging to that state. I was thinking I could use link_to_remote from the prototype library to do this using the :onchange option in the collection_select, but that didn't seem to work. I'm curious as to how I can code the view and the controller to do such a thing.
Anyone have a suggestion? Thanks in advance! -- BTR