Forum: Ruby on Rails link_to_remote to update multiple components

Announcement (2017-05-07): is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see and for other Rails- und Ruby-related community platforms.
06c5024af4f25b3da3588da0999d8ff7?d=identicon&s=25 Heist (Guest)
on 2006-04-11 16:37
How would go about to update multiple components when using

I've got a button that lets you switch between languages and it has to
update every component in my application (like, let's say: the main
screen, the top navigation bar and the search bar). Each component is
created in a different DIV and whenever the language is switched, the
entire application should reflect the change.

Using update_element_function is pretty much out of the equation because
I can't specify  a controller/action for content (instead of *ugh* just
plain html). Same goes for using rjs.
0a5d6fa912dda67f9b81017fbd9a81f2?d=identicon&s=25 Shane Sherman (Guest)
on 2006-04-12 00:04
(Received via mailing list)
for something like that you should not be using submit_to_remote. It's
to be much easier to just use a normal submit and post-back and do a
redirect_to that will refresh the entire app.
2cf7af8ebb619eeb30178dd8855245b8?d=identicon&s=25 Charlie (Guest)
on 2006-04-12 04:17
Using rjs is easier to update multiple dom response to each ajax can do sth like this:

    render :update do |page|
      dom_partials_map.each do |domdiv,partialtemplate|
        page.replace_html domdiv, :partial=>partialtemplate

Heist wrote:
> How would go about to update multiple components when using
> link_to_remote?
This topic is locked and can not be replied to.