-
Notifications
You must be signed in to change notification settings - Fork 49
Description
What's the issue?
When accessing AdminV2::Classrooms#index, the page crashes with:
NoMethodError: undefined method grade for an instance of Classroom
The error originates from:
app/views/admin_v2/classrooms/index.html.erb:52
The view is still calling:
classroom.grade
However, the old grade attribute was removed and replaced by the grades association (backed by the new grades table). Updating the view to use classroom.grades resolves the exception.
Additional occurrences
The same issue also occurs in AdminV2::Classrooms#show.
That view uses:
<%= admin_show_attributes(
@classroom,
attributes: %i[
id name grade archived trading_enabled
school_year created_at updated_at
]
) %>Here, grade is still referenced. Replacing it with grades prevents the crash and allows the page to render.
Remaining issue
Although changing grade → grades fixes the error, the grades are not displayed correctly.
This seems to be because admin_show_attributes does not use the display_grades method that was previously used in the old admin panel. As a result, the grades association is rendered without the intended formatting.
Additional details
.
Metadata
Metadata
Assignees
Labels
Type
Projects
Status