Forum: Ruby on Rails expanding details examples?

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.
56493a3c223a155bbe2b44bdf55ef184?d=identicon&s=25 Mike Oligny (Guest)
on 2006-05-28 02: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 =>
'order_item_form'

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

   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,
-Mike
This topic is locked and can not be replied to.