azback5 said almost 3 years ago on User Notifications :
Hey  ... I'm having some trouble implementing the notifications feature into my rails app.

The notifications counter updates perfectly in my app layout view, but when I try to click on the notifications url I keep receiving a 500  NameError and it's parsing through and fussing with a link to root_path in my app/layout which doesn't make sense, to me as I know that works fine.

in my comment.rb model

class Comment < ApplicationRecord

  after_commit :create_notifications, on: :create

  belongs_to :commentable, polymorphic: true
  has_many :comments, as: :commentable
  belongs_to :user, optional: true

  validates :body, presence: true

  def deleted?


  def create_notifications
   Notification.create do |notification|
     notification.notify_type = 'commentable' = self.user
     notification.user = self.commentable.user = self
     notification.second_target = self.commentable


in my views/notifications/_commentable.html.erb
<div class=''>
  <%= link_to, main_app.user_path( %> has commented in


<div class=''>
  <%= %>

Do you have any ideas as to what might be creating the fuss?

Thanks a lot!