Closed dcalixto closed 5 years ago
You need add app/views/notifications/_comment.html.erb
for write template for comment
type/
@huacnlee thank you, just one doubt, i added in right place, but now show Showing
/home/daniel/jexts/app/views/notifications/_comment.html.erb where line #2 raised:
undefined method `user_path' for #<#<Class:
and if i remove the link_to from the partial shows:
/home/daniel/jexts/app/views/notifications/_comment.html.erb:2: syntax error, unexpected ')', expecting '=' ....username, notification.actor );@output_buffer.safe_append='... ... ^ /home/daniel/jexts/app/views/notifications/_comment.html.erb:5: syntax error, unexpected keyword_ensure, expecting ')'
so, i have to change the will_paginate to kaminari?
You can rewrite notifications_controller.rb
to use will_paginate
# app/controller/notifications_controller.rb
class NotificationsController < Notifications::NotificationsController
def index
@notifications = Notification.where(user_id: current_user.id).includes(:actor).order('id desc').paginate(params[:page])
unread_ids = @notifications.reject(&:read?).select(&:id)
Notification.read!(unread_ids)
@notification_groups = @notifications.group_by { |note| note.created_at.to_date }
end
end
# config/routes.rb
resources :notifications
@huacnlee thank you very much! but if change to will_paginate
shows another issue:
undefined method
fetch' for nil:NilClass`
need more details / context of this error message