excid3 / madmin

A robust Admin Interface for Ruby on Rails apps
https://github.com/excid3/madmin
MIT License
546 stars 62 forks source link

Madmin errors - Users and notifications #168

Closed Ahmed-Nazeeh closed 10 months ago

Ahmed-Nazeeh commented 1 year ago

NameError in Madmin::Users#index Showing /home/.../gems/madmin-1.2.7/app/views/madmin/fields/has_many/_index.html.erb where line #1 raised:

Rails couldn't find a valid model for Notification association. Please provide the :class_name option on the association declaration. If :class_name is already provided, make sure it's an ActiveRecord::Base subclass. Extracted source (around line #50):

<% next if attribute.field.nil? %>
            <% next unless attribute.field.visible?(action_name) %>
            <td class="px-4 py-2"><%= render partial: attribute.field.to_partial_path("index"), locals: { field: attribute.field, record: record, resource: resource } %></td>
          <% end %>

          <td class="px-4 py-2 text-center">

And there is another error when click on the notification icon in navbar

NameError in NotificationsController#index Rails couldn't find a valid model for Notification association. Please provide the :class_name option on the association declaration. If :class_name is already provided, make sure it's an ActiveRecord::Base subclass.

  def index
    # Convert the database records to Noticed notification instances so we can use helper methods
    @notifications = current_user.notifications.map(&:to_notification)
  end
end
Ahmed-Nazeeh commented 1 year ago

Solution was to install the noticed gem.

fbuys commented 11 months ago

Can we close this issue, since you are able to resolve it by installing the notice gem. Or do you believe this is still a bug to be addressed inside of madmin?