Forum: Ruby on Rails expanding details examples?

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.
Mike O. (Guest)
on 2006-05-28 04:38
(Received via mailing list)
I'm currently using page.visual_effect :toggle_appear to toggle the
appearance of details associated with an order.  As I am inserting
the detail data prior to making it visible, this method is not
appropriate (it also loads the data on hide).

I was thinking I could change the hide/show href each time it is
clicked, or even store a value on the page and toggle it each time
it's clicked - but it seems like there must be a better solution.

Here's my makeshift .rjs template:

   page.replace_html "items" + params[:id].to_s, :partial =>
'order_item', :collection => @order_items
   page.replace_html "item_footer" + params[:id].to_s, :partial =>

   page.replace_html "comments" + params[:id], :partial =>
'order_detail', :collection => @order_details
   page.replace_html "comment_footer" + params[:id].to_s, :partial =>

   page.visual_effect :toggle_appear, 'item_container' + params
[:id].to_s, 'duration' => 0.5

All of the RJS tutorials / examples I've been able to find are quite
basic - is there a good place for information on this stuff?

Thanks in advance,
This topic is locked and can not be replied to.