Forum: Ruby on Rails Using Ajax to do more than 1 render

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.
6828ffc79486cd2442714bf32286a910?d=identicon&s=25 krishna.vivek (Guest)
on 2005-12-02 14:29
(Received via mailing list)
Hello all ,
  I am a newbie to rails but thanks to the tutorials I have created in
less
than a week's time a dynamic ajax enabled test page which is shown to a
user
when he/she logs in. I am exploring the Javascript helper class and I
was
wondering if there is some way to update multiple portions of a web
page.

For example  the page has a box on the right where in a user can add
some
tags.Now I need to update the portion of the page which shows a listing
of
all user tags and also another portion of a page whose content is
determined
by the tags added. I use the render :partial to update the first part
but I
am kind of clueless about how to acheive the second update.Any ideas?

Also does Rails provides a way to add a text box which basically
functions
like the form_remote_tag .But I want the text box to appear only when a
link
is clicked and also provide a link to hide it.I suspect i need to write
some
javascript here but I just want to know how far rails can take me.

thanks
vivek
821395fe70906c8290df7f18ac4ac6cf?d=identicon&s=25 technoweenie (Guest)
on 2005-12-02 15:06
(Received via mailing list)
On 12/2/05, Vivek Krishna <krishna.vivek@gmail.com> wrote:
> am kind of clueless about how to acheive the second update.Any ideas?
>
>  Also does Rails provides a way to add a text box which basically functions
> like the form_remote_tag .But I want the text box to appear only when a link
> is clicked and also provide a link to hide it.I suspect i need to write some
> javascript here but I just want to know how far rails can take me.
>
>  thanks
>  vivek

Rails can take you all the way from here to the moon and back.

You'll have to use #update_element_function [1] to update multiple
regions.  RJS templates[2] make this a lot easier.

As for text boxes, scriptaculous provides the In-Place Editor [3].
Otherwise you can just write your own js to toggle the textbox on the
click of a link.

1.
http://rails.rubyonrails.com/classes/ActionView/He...

2.
http://rails.techno-weenie.net/tip/2005/11/29/ajax...

3. http://wiki.script.aculo.us/scriptaculous/show/Aja...

--
rick
http://techno-weenie.net
This topic is locked and can not be replied to.