def namespaced_resources(target, opts = {}, &block)
        if target.include?('/')
          the_namespace = target[0..target.index('/') - 1]
          new_target = target[target.index('/') + 1..-1]
          namespace the_namespace, ROUTE_OPTIONS.fetch(the_namespace, {}) do
            namespaced_resources(new_target, opts, &block)
          end
        else
          resources target, opts do
            yield if block_given?
          end
        end
      end
def namespaced_resources(target, opts = {}, &block)
        if target.include?('/')
          the_namespace = target[0..target.index('/') - 1]
          new_target = target[target.index('/') + 1..-1]
          namespace the_namespace, ROUTE_OPTIONS.fetch(the_namespace, {}) do
            namespaced_resources(new_target, opts, &block)
          end
        else
          resources target, opts do
            yield if block_given?
          end
        end
      end
Namespaces routes appropriately
 @example namespaced_resources("hyrax/my_work") is equivalent to
   namespace "hyrax", path: :concern do
     resources "my_work", except: [:index]
   end