Most of the Rails helpers assume you're just going to update a specific section in the page. The most straight forward and least efficient way to do it is to expand the scope of “specific section” to include both the view elements for A-records and B-records. (Which could be the entire page, as you mention.)
More efficiency will likely involve more complexity as well. I'd say this holds true for my answer too.
My immediate thought here is a generic event mechanism. You basically issue your AJAX call to update as usual, and the response contains multiple return values that contain updates for specific A or B records. For example:
{ "A": [
{ "id": 23, "content": "<span>name:</span> Apples" },
{ "id": 52, "content": "<span>name:</span> Oranges" }
],
"B": [
{ "id": 10, "content": "<span>name:</span> Fruits" }
]
}
Then, AJAX calls for updates to both A and B-records are issued, and their responses are handled by a single JavaScript function. That single function then takes care of dispatching the update to the separate view components you want. Think of it as a simple event handler.
The simplest way to implement this is probably to have each view component register itself with an 'update' function on page load. Your event handler then calls all of these with the JSON object. The update functions then take what they want, update the specific elements they manage, and you're set.