Crash when Show user in the Admin dashboard
I would like to impersonate another user. When I click on the user on the user list, it crashes with the following message when user has avatar image with the following message
NameError in Admin::Users#show
Showing /home/david/.rbenv/versions/2.6.3/lib/ruby/gems/2.6.0/bundler/gems/administrate-66c6d333106b/app/views/fields/has_one/_show.html.erb where line #22 raised:
uninitialized constant AvatarAttachmentDashboard
It is OK if the user does not have avatar. What is wrong ?
require "administrate/base_dashboard" class UserDashboard < Administrate::BaseDashboard ATTRIBUTE_TYPES = { id: Field::Number, ... # avatar_attachment: Field::HasOne, # <============= COMMENT THIS OUT # avatar_blob: Field::HasOne, # <=================== COMMENT THIS OUT ... }.freeze # SHOW_PAGE_ATTRIBUTES # an array of attributes that will be displayed on the model's show page. SHOW_PAGE_ATTRIBUTES = [ :id, ... # :avatar_attachment, # <======================== COMMENT THIS OUT # :avatar_blob, # <============================== COMMENT THIS OUT ... ].freeze end
I just published a fix for this. I've added ActiveStorage support to the admin (using this) so the avatars are now set as activestorage fields. You can also add your own AS fields to the admin easily.
Notifications
You’re not receiving notifications from this thread.