<%= collection.each do |record| %>
<%= link_to record.name, polymorphic_path([:admin, record]) %>
<% end %>
打破这条路线:
resources :users, as: "authors", path: "authors", except: [:create, :destroy]
错误:
undefined method `admin_user_path'
有人可以帮忙吗?
我把它作为Rails错误
答案 0 :(得分:1)
您还应该在admin namespace
中定义用户资源namespace :admin do
resources :users
end