elight / acts_as_commentable_with_threading

Similar to acts_as_commentable; however, utilizes awesome_nested_set to provide threaded comments
MIT License
672 stars 167 forks source link

Ajax #102

Open ghost opened 8 years ago

ghost commented 8 years ago

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>):