Forum: Ruby on Rails Ajax: update multiple DIV's

Announcement (2017-05-07): www.ruby-forum.com is now read-only since I unfortunately do not have the time to support and maintain the forum any more. Please see rubyonrails.org/community and ruby-lang.org/en/community for other Rails- und Ruby-related community platforms.
783fed8af50259766b40d2f550ec5974?d=identicon&s=25 zven (Guest)
on 2006-06-02 18:15
(Received via mailing list)
Hello.

Is it possible to update multiple DIVs during? For example I have DIV
for @flash[:notice], and one for content and I need to render both DIVs
after executing action.
5d15c6821f3c3054c04b85471824ba7c?d=identicon&s=25 Dave Teare (Guest)
on 2006-06-03 19:05
(Received via mailing list)
If I understand your question correctly, RJS will make this a snap.  The
new RJS is wickedly cool - give it a whirl.  Here's some docs:
  - http://www.codyfauser.com/articles/2005/11/20/rail...
  - http://scottraymond.net/articles/2005/12/01/
real-world-rails-rjs-templates

Here's some code I wrote recently for my new Mac Password Manager:

    render :update do |page|
      if saved
        page.hide "form"
        page.replace_html "status", 'Thank you! Your message has been
sent.'
      else
        page.replace_html "status", 'Please enter the message.'
      end
    end

You can do all sorts of cool things with that "page" object, including
visual effects a-la script.aculo.us.  See http://api.rubyonrails.org/
classes/ActionView/Helpers/PrototypeHelper/JavaScriptGenerator/
GeneratorMethods.html for details.

HTH.

On Friday, June 02, 2006, at 10:15 PM, zven wrote:
>http://lists.rubyonrails.org/mailman/listinfo/rails
Cheers!
--Dave Teare
http://1passwd.com - Password Manager + AutoFill for Mac OS X
http://devlists.com - Email list management
http://palmsphere.com - Apps for your hand-held
This topic is locked and can not be replied to.