[jQuery] JQuery UI Accordion Plugin
I am a Rails developer and new to jQuery so this may be a naive
question:
I am using jQuery Accordion plugin in my project and it is working,
but now I am trying to tweak it and do not know how to:
So I have a page that displays comments as a stack of accordion
folds. This is the code in my application.html.erb (master layout)
file:
$("#accordion").accordion({ autoHeight: false, event:
'mouseover' });
This works fine. There is a Rails form on this page where I allow the
users to create a comment, and submit it. Upon submission, the
"prepends" the notes record as shown below:
$("#accordion").prepend("<%= escape_javascript(render(:partial =>
'shared/comment', :object => @comment)) %>");
$("#new_comment")[0].reset();
What is totally confusing me is that this is showing on the page, but
is not a part of the accordion. As a matter of fact, when I view the
page source, the entry is not even there on the page, yet it is being
shown in the browser. How could that be? There is something
fundamental that I am missing here.
Kindly explain.
Thanks.
Bharat