Giter VIP home page Giter VIP logo

Comments (8)

huacnlee avatar huacnlee commented on June 15, 2024

You need add app/views/notifications/_comment.html.erb for write template for comment type/

from notifications.

dcalixto avatar dcalixto commented on June 15, 2024

@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 ')'

from notifications.

huacnlee avatar huacnlee commented on June 15, 2024

https://github.com/rails-engine/notifications/blob/master/test/dummy/app/views/notifications/_comment.html.erb#L3

from notifications.

huacnlee avatar huacnlee commented on June 15, 2024

https://github.com/rails-engine/notifications/pull/19/files

from notifications.

dcalixto avatar dcalixto commented on June 15, 2024

so, i have to change the will_paginate to kaminari?

from notifications.

huacnlee avatar huacnlee commented on June 15, 2024

You can rewrite notifications_controller.rb to use will_paginate

https://github.com/rails-engine/notifications/blob/master/app/controllers/notifications/notifications_controller.rb#L4

# 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

from notifications.

dcalixto avatar dcalixto commented on June 15, 2024

@huacnlee thank you very much! but if change to will_paginate

shows another issue:

undefined method fetch' for nil:NilClass`

from notifications.

huacnlee avatar huacnlee commented on June 15, 2024

need more details / context of this error message

from notifications.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.