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

Readme lacks example code for integrating with forms #74

Open
ahnbizcad opened this issue Jun 2, 2014 · 5 comments
Open

Readme lacks example code for integrating with forms #74

ahnbizcad opened this issue Jun 2, 2014 · 5 comments

Comments

@ahnbizcad
Copy link

An example form would be immensely helpful. It would be a trivial matter for experts, but incredibly helpful and time-saving for newcomers. And for a good % of the time, a deciding factor for newcomers to use this gem instead of seeking other sources.

The current code for controllers, do they all go in the "Articles" controller? Which scope or file do they go into? This kind of information of often overlooked by experts, professors, and people who have been doing things for a long time because it' intimate knowledge to them, and often becomes a blind-spot in terms of teaching.

Some examples of ambiguity and confusion:

  1. The following wording makes it seem like you need to write this code in the model. Easily un-confused by labeling the file name that this code should go in, (i.e. articles_controller.rb or should it be comments_controller.rb I still can't tell.)?
Add a comment to a model instance, for example an Article:

@article = Article.find(params[:id])
@user_who_commented = @current_user
@comment = Comment.build_from( @article, @user_who_commented.id, "Hey guys this is my comment!" )
  1. where does this goo?
To make a newly created comment into a child/reply of another comment:

@comment.move_to_child_of(the_desired_parent_comment)

Other issues:

How to you properly use the "lft" and "rgt" integer columns?

The generator command doesn't produce a comments controller. Do we need a comments controller though? If not, how do you create comments? This is where an example form would help. Especially using it with ajax, which is most likely what everyone wants to do with it.

The model is under app/models/ for rails, not lib/

In lib/comment.rb uncomment the line acts_as_votable.
@ahnbizcad ahnbizcad changed the title Readme lacks example code for form integration. Readme lacks example code for integrating with forms Jun 2, 2014
@ahnbizcad
Copy link
Author

@tezzataz
Copy link

That guide is pretty useless with reference to this gem, it doesn't show how to enable threaded comments or how to reply to parent comments. Grateful for this gem but the read me and documentation is basic at best.

@DustinFisher
Copy link

I know this is an older issue, but I will throw this up here if someone else comes across this and looking for an example.

I worked through pieces and parts I found across the web and got threading working. I put a guide together showing how to get up and running.

Here is the example I put together: acts_as_commentable_with_threading example

@RailsCod3rFuture
Copy link

@DustinFisher did you add AJAX POST/Destroy?

@RailsCod3rFuture
Copy link

@DustinFisher Can you please add AJAX request to your tutorial, and then report back to the community? Thanks. Your example tutorial is great, btw.

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

4 participants