RoR and Ajax

I want to use RoR and its built-in Ajax functions to display a list of
objects on a page like so:


Item 1
Item 2
Item 3

each item, when clicked on will load a description of the item. I want
to do this w/out loading another page and just want it rendered on the
same page. Is this possible or am i overstepping functionality here?

Example…from the list above, say i click item 2 like so:


Item 1
Item 2 click
Item 3


back
Item 2
Info…blah blah blah
more info on item 2…

Certainly is possible. You’ll want to use a combination of hidden DIVs
and RJS to show those DIVs again. Before showing the DIV you can also
replace the contents of the DIV using RJS.

Lots 'o tutorials floating around on the web.


Roderick van Domburg

I did something similiar with a credit card list, but I think if you had
a list and a hidden div and then set up your list items as links using
the link_to_remote helper you could then use the :update symbol to
update that hidden div without reloading the page.

<%= link_to_remote ‘Delete’, :url => { :action => ‘delete_credit_card’
}, :update => ‘credit_card_table’ %>

credit_card_table would be my hidden div. Then in my delete_credit_card
method I could render :partial or render_text so that when the :update
happens it knows what to update with.

Hope this helps, good luck,

~S

Roderick van Domburg wrote:

Certainly is possible. You’ll want to use a combination of hidden DIVs
and RJS to show those DIVs again. Before showing the DIV you can also
replace the contents of the DIV using RJS.

Lots 'o tutorials floating around on the web.


Roderick van Domburg
http://www.nedforce.nl

would you mind linking me to some of these as i am unable to find them.
At least in any sort of manner that i can understand. thanks