Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ajax #102

Open
ghost opened this issue Mar 26, 2016 · 0 comments
Open

Ajax #102

ghost opened this issue Mar 26, 2016 · 0 comments

Comments

@ghost
Copy link

ghost commented Mar 26, 2016

I have done the implementation of threaded comments by using the acts_as_commentable_with_threading gem and everything is fine but I cannot seem to be able to implement ajax for it.

I have implemented in comments that were not threaded but with threaded comments I don't seem to be able to do it.

$('#comments').append('<%= j render @comment %>');
This line is the problem but I don't know how to make it work. If I change :

$('#comments').append('Hi!');
It works so there is no ajax fault it must be the <%= j render @comment %> The comments get created but it doesn't get appended to the page. I get this error

POST http://localhost:3000/comments 500 (Internal Server Error)
I followed this tutorial for the implementation of the plain threaded comments http://dustinfisher.com/acts-as-commentable-with-threading-gem/

Please If you know let me now on where the problem is.
http://stackoverflow.com/questions/36227467/acts-as-commentable-with-threading-ajax-not-working
Edit This error also pops in the terminal for commentable and new_comment ActionView::Template::Error (undefined local variable or method `commentable' for #<#:0x0000000c396398>):

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

0 participants