So I'm trying out the Public Activity gem for a notification timeline and I don't understand why I'm getting the NameError , uninitialized constant message. Here's the error I'm getting:
NameError in ActivitiesController#index
uninitialized constant ActivitiesController::PublicActivity
app/controllers/activities_controller.rb:3:in `index'
uninitialized constant ActivitiesController::PublicActivity
Here's my controller code where the error is said to be:
class ActivitiesController < ApplicationController
def index
@activities = PublicActivity::Activity.order("created_at desc")
end
end
I'm trying this out based on a rails cast: http://railscasts.com/episodes/406-public-activity And as far as I know I've done the same thing as the one on it.
There isn't any activity model, but here's the post and comments model where I used the PublicActivity module:
POST MODEL:
class Post < ActiveRecord::Base
include PublicActivity::Model
tracked
COMMENT MODEL
class Comment < ActiveRecord::Base
include PublicActivity::Model
tracked
belongs_to :post
belongs_to :user
end