views:

115

answers:

1

Hello, I'm building a Rails 3 app and am trying to install acts_as_commentable

Here's what I did: Added to my Gemfile:

gem "acts_as_commentable"

Ran bundle install

Generated a Migration with the comments.rb (Comments table was created correctly)

I then wanted to enable my book controller for commenting, so I added to books_controller.rb

acts_as_commentable

But now I get an error when I load /books:

Routing Error

undefined local variable or method `acts_as_commentable' for BooksController:Class

Suggestions?

+1  A: 

The act_as_commentable is only define in Model. So you need define in your model, not your controller.

shingara
Woops! I should have had my cup of coffee this morning. Thank you! Do you know of any tutorials on how to actually implement commenting on a model/controller like Books. How to add it to the view's show page, add some ajax etc?
AnApprentice
The usage in gem repository seems good : http://github.com/jackdempsey/acts_as_commentable
shingara
The usage is at the model level, not the integration level. Does that make sense?
AnApprentice