Simplify uses of polymorphic admin nested routes

This commit is contained in:
Javi Martín
2020-03-16 15:41:48 +01:00
parent 59f70641cb
commit 334b57501b
11 changed files with 20 additions and 20 deletions

View File

@@ -63,4 +63,8 @@ module ActionDispatch::Routing::UrlFor
polymorphic_path(resources)
end
end
def admin_polymorphic_path(resource, options = {})
polymorphic_path([:admin, *resource_hierarchy_for(resource)], options)
end
end