I think there may be a bug in Rails... I wanted to use this as well
(it's documented in the Rails API docs as an example at
http://api.rubyonrails.com/classes/ActionView/Helpers/JavaScriptHelper.html
as a link_to_function example). I believe it has to do with the use
of the toggle_blind method on the $() prototype function -- maybe that
method is not being added properly? I tested many different
combinations and did find one that worked:
page.visual_effect :toggle_blind, 'details' <== my div id; same as
your "comment_form
Notice that you can't use the element proxy of page[:comment_form] as
it winds up returning the $() form which fails. Here are the
different variations that I tried: