A Rails 6.0 uses gem administrate
. Users flagged as admin access the pages properly.
The user index is displayed and, for example, the edit page is accessible:
/admin/users/2579/edit
but calling the same object's show page returns an error
undefined method `admin_role_path'
pointing to line 59 of app/views/admin/application/_collection.html.erb
which is automaatically generated by the administrate gem
<%= %(tabindex=0 role=link data-url=#{polymorphic_path([namespace, resource])}) %>
Trace of template inclusion: #<ActionView::Template /.rbenv/versions/2.6.1/lib/ruby/gems/2.6.0/gems/administrate-0.14.0/app/views/fields/has_many/_show.html.erb locals=["field", "page"]>, #<ActionView::Template app/views/admin/application/show.html.erb locals=["page"]>
I remove all the code and replaced it with a simple <%= ressource %>
, toggling the equals sign to a hash.
Three join (of has_many) classes have an ActiveRecord_AssociationRelation
which undestandably invokes the collection form. <%= ressource.inspect %>
allows to view the details of each relation.
Still the mechanics of the error generation are opaque to me as the aformentioned path is not found in the repository.
What is the source of the problem and how can it be managed?