Questions tagged [acts-as-commentable]

56 questions
11
votes
3 answers

Is there a clean approach to implement acts_as_commentable in a Rails application?

The README does not show how to handle the controller and view aspects of setting up this plugin. I have been searching for a couple hours and can't find anything that shows how to use this plugin.
eksatx
  • 1,023
  • 2
  • 10
  • 15
6
votes
3 answers

acts_as_commentable examples?

I have a model that I want to be commentable. I am having difficulty creating a form on my model's 'show' view that will allow comments to be created. I am not finding any good or useful examples. Can anyone point me to or show me an example of how…
NJ.
  • 2,155
  • 6
  • 26
  • 35
5
votes
1 answer

What's the replacement for acts_as_commentable in Rails 6, Ruby 3.0.2?

I upgraded our app to Rails 6.1.4.4 and Ruby 3.0.2. I have this old gem gem 'acts_as_commentable' Locked at version 4.0.2. The gem does not appear to be supported anymore, which is a shame because when I start up my app or console, I now get this…
Dave
  • 15,639
  • 133
  • 442
  • 830
4
votes
3 answers

Duplicate ID's being generated violating primary key contraints

Can anyone help explain this? I am using the Populator and Faker gems to put some generated data into my database. Among other things, I generate 10,000 comments (which are from the 'acts_as_commentable' gem. All this works. However, when I go to…
NJ.
  • 2,155
  • 6
  • 26
  • 35
4
votes
1 answer

Rails: Ordering from within a view

I'm using the acts_as_commentable_with_threading gem. This gem includes the method 'comment.children', which creates a hash of all the child comments. By default, it orders the children by created_at ASC. I want to change the way the children are…
nullnullnull
  • 8,039
  • 12
  • 55
  • 107
4
votes
2 answers

Get most commented objects

I'm using acts_as_commentable_with_threading gem to make users able to comment my blog posts. What I want to do now is to display most commented posts but I have no idea how to query them (and as far as I know, the gem not provides such method).…
mbajur
  • 4,406
  • 5
  • 49
  • 79
3
votes
1 answer

rails routing: nested resources with different namespace

I am trying to use the acts_as_commentable GEM to add comments to my Post Model. I am using ABC as namespace, so all my controller and models named as ABC::Post, ABC::User, etc. Currently my routing setup is as following. namespace :abc do …
ziweizhou
  • 165
  • 7
3
votes
2 answers

Why does this form think it should route to index?

I have a simple_form_for new_comment that results in a undefined methodcomments_path'` error in the browser, when I simply try to view the form (not submit) _form.html.slim = simple_form_for new_comment, :remote => true do |f| This is in a partial,…
ahnbizcad
  • 10,491
  • 9
  • 59
  • 85
2
votes
1 answer

Rails 4, acts_as_commentable, delete button / link

I have a User model which is commentable: class User < ActiveRecord::Base acts_as_commentable In the Users controller I am grabbing the comments like this: @comments = @user.comments.recent.page(params[:notifications]).per(10) And in the Users…
John Trichereau
  • 626
  • 9
  • 22
2
votes
1 answer

Acts_as_commentable: AssociationTypeMismatch

I'm using "acts_as_commentable" gem, but If i try to create a new comment to a "status" I get this error. Controller Update: If I use this, I don't get any errors but it doesn't save the comment into database private def status_params …
sparkle
  • 7,530
  • 22
  • 69
  • 131
2
votes
2 answers

Mass assignment error using acts_as_commentable_with_threading

I've been following this tutorial to implement threaded comments with the acts_as_commentable_with_threading gem. However, I seem to be running into a mass assignment error that seems to stem from the way the gem sets up the Comment model, which I'm…
2
votes
0 answers

Rails acts_as_commentable_with_threading and nested routes

I have the following route: resources :organisations do resources :comments, only: [:create, :destroy] resources :events do resources :comments, only [:create, :destroy] end end As the documentation for AACWT example suggests, I try…
Ashley Bye
  • 1,752
  • 2
  • 23
  • 40
1
vote
1 answer

acts_as_commentable_with_threading uninitialized constant Post::Comment Rails 3.1.3

I have upgraded my application from Rails 2.3.5 to Rails 3.1.3. I had acts_as_commentable_with_threading and awesome_nested_set as plugins. Now I have added in GemFile for Rails 3.1.3 as below gem 'awesome_nested_set' gem…
1
vote
0 answers

'acts_as_commentable_with_threading' not saving comments

Here is my form: <%=form_for [current_user, @tattoo, @comment], :remote => false, :html =>{:multipart => true} do |f|%>
  1. <%=f.hidden_field :commentable_id, :value=> @tattoo.id %>
    <%=f.text_area…
rugbert
  • 11,603
  • 9
  • 39
  • 68
1
vote
1 answer

How do I use formtastic to create a remote form using acts_as_commentable in Rails 3?

I am using acts_as_commentable. This is how the Model has comments added to it: commentable = Post.create commentable.comments.create(:title => "First comment.", :comment => "This is the first comment.") the gem specifics can be found…
Satchel
  • 16,414
  • 23
  • 106
  • 192
1
2 3 4