Conditional toggle button

I'd do it like so:

<%=link_to_function "Link", "if(Element.visible('divid')) {             Element.hide('divid')         } else {             " + remote_function(:url=>{:action=>"blah"}, :loading=>whatever) + "}" %>

and you could write a helper function that would take the arguments name, element id and options and output the above too.

Fredrik Thuresson wrote: