Also, when I try to use strftime in “comments.rhtml” it says that it’s
undefined.
I don’t even know if the above things that I mentioned are even the
right way to go about it, I just don’t know how to do it.
The comments are saving to the database fine, but I have to refresh the
page to get it to show up. Also, I would like to use
“Effect.Appear(‘new-comment’)” oncomplete. This doesn’t seem to be
working either.
Can someone tell me how to display the comment after an Ajax submission?
I don’t even know if the above things that I mentioned are even the
right way to go about it, I just don’t know how to do it.
The comments are saving to the database fine, but I have to refresh the
page to get it to show up. Also, I would like to use
“Effect.Appear(‘new-comment’)” oncomplete. This doesn’t seem to be
working either.
Can someone tell me how to display the comment after an Ajax submission?
I THINK CRAIG NAILED IT ON THE HEAD RYAN !
THANKS CRAIG. MY CAPSLOCKS KEY MUST BE STUCK
Yes, I can access the name, site, and entry that way, but not the
“created_at” attribute.
How can I access this variable? I guess since it’s automatically
created, it doesn’t show up in the params?
Also, how can I return a count one more than the last comment?
Essentially, displaying #1, #2, #3 with each comment.
Right now, on page load, I’m incrementing a counter inside of the for
loop which iterates through the comments, but since I’m trying to do
ajax, this part won’t be involved in the for loop.
OK - I will bite, even if you posted the topic in caps.
The return from the AJAX call will need to update a div in your page.
Try to get it working by just returning
render_text ‘done’. When you see your page updating the div with ‘done’
you can then try returning the actaully content that you want displayed.
I find the best way to do this is using a partial. To illustrate, here
is an AJAX action from the app that I am currently working on.